LaravelPackages.net
Acme Inc.
Toggle sidebar
kreitje/l4-schemad-migrations

Generate a schema file for Laravel migration with a MySQL database.

10
2
About kreitje/l4-schemad-migrations

kreitje/l4-schemad-migrations is a Laravel package for generate a schema file for laravel migration with a mysql database.. It currently has 2 GitHub stars and 10 downloads on Packagist. Install it with composer require kreitje/l4-schemad-migrations. Discover more Laravel packages by kreitje or browse all Laravel packages to compare alternatives.

Last updated

#Laravel4 Schemad Migrations

This will generate a schema.php file in your app/database/migrations file based on your current database schema. This only works with MySQL. When your run php artisan migrate it will automatically generate the schema file for you after the migrations have run.

This code is based off of http://laravelsnippets.com/snippets/convert-an-existing-mysql-database-to-migrations by michaeljcalkins

##Setup

Modify your config/app.php and update the providers to:

Comment out the following line:

'Illuminate\Database\MigrationServiceProvider',

Add in the following line:

'Kreitje\L4SchemadMigrations\L4SchemadMigrationsServiceProvider'
Comments