A common situation that occurs during the development process is that a schema is created, and then, we need to create a migration from that schema. At the time of writing, there is no official tool to do this in the Laravel core, but there are several packages available.
One such package is the migrations-generator
package.
First, add the following line to the require-dev
section of the composer.json
file to require the migrations-generator
dependency in the composer.json
file:
"require-dev": { "phpunit/phpunit": "~4.0", "phpspec/phpspec": "~2.1", "xethron/migrations-generator": "dev-feature/laravel-five-stable", "way/generators": "dev-feature/laravel-five-stable" },
It is also necessary to add the following text to the composer.json
file at the root level:
"repositories": [ { "type": "git", "url": "[email protected]:jamisonvalenta/Laravel-4-Generators.git" }],