laravel-schema-drift maintained by emirkefi
Laravel Schema Drift Detector
A powerful, zero-config Artisan command to detect schema drift between your live database and your Laravel migration files.
Ever wonder if someone manually tweaked a database column directly in production without writing a migration? Or if a legacy table is sitting in your database completely untracked? This package catches those discrepancies instantly.
How It Works
Behind the scenes, the package uses a clever "shadow database" approach:
- It takes a snapshot of your live database schema.
- It spins up a temporary, in-memory SQLite database and runs all your migration files.
- It compares the two schemas and outputs a beautiful terminal table highlighting any missing tables, untracked columns, nullability mismatches, and index discrepancies.
Requirements
- PHP 8.2 or higher
- Laravel 11.0, 12.0, or 13.0
- SQLite PHP extension enabled (for the shadow database)
Installation
You can install the package via composer. Since this is a developer tool, it is highly recommended to install it as a dev dependency:
composer require emirkefi/laravel-schema-drift --dev