SQL to Laravel Migration Converter
Convert raw SQL CREATE TABLE statements to Laravel migration code.
SQL CREATE TABLE Statement
Laravel Migration Code
Next Steps: Create a migration file using
php artisan make:migration create__table and paste this
code into the up() method.
Features
- Convert SQL CREATE TABLE to Laravel Schema builder
- Automatic type mapping (VARCHAR → string, INT → integer, etc.)
- Handles PRIMARY KEY, UNIQUE, NOT NULL constraints
- Supports AUTO_INCREMENT and DEFAULT values
- Generates clean, readable Laravel migration code
How to Use
- Paste your SQL CREATE TABLE statement
- Click "Convert to Migration"
- Review the generated Laravel Schema code
- Create a new migration file using artisan
- Copy the generated code into the up() method
- Run
php artisan migrate