SQL to Laravel Migration Converter
Turn CREATE TABLE statements from SHOW CREATE TABLE or mysqldump into a Laravel migration, with foreignId, timestamps, softDeletes and indexes recognised.
Free · No sign-up · Your inputs stay in your browser
Input
Convert CREATE TABLE to a Laravel migration
Output
Migration
1 table
Recognises Laravel's own conventions on the way back: id(), timestamps(), softDeletes(), rememberToken(), foreignId()->constrained() and the default index names, so a schema Laravel created round-trips to the migration that made it. CHECK constraints, generated columns and triggers have no Blueprint method and are skipped.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
When you need it
Adopting migrations on a database that was built by hand, porting a legacy application to Laravel, or turning a schema designed in a GUI tool into code. For a whole existing database, php artisan schema:dump is the official way to start from the current state; this is for the tables you want as readable, editable migrations. The migrations documentation lists every column type.
What does not convert
CHECK constraints, generated columns, triggers, partitioning and table options other than the engine have no Blueprint method, so they are left out. Add them with DB::statement() in the migration.