Search code examples
laravellaravel-4

how to create migration from existing database in laravel?


I know command to create database from laravel migration.

I have already created database in mysql. so how can i convert migration from that database?


Solution

  • You could use Jeffrey Way's generator tool for Laravel 4, and do them by hand. It is a very useful tool. https://github.com/JeffreyWay/Laravel-4-Generators (if you are using Laravel 5, use this package instead: https://github.com/laracasts/Laravel-5-Generators-Extended)

    Or you could try out one of the following packages, they should convert your existing schema to Laravel migrations. I have not tried them, but have a look:

    Also, read the following answer in another question, might be useful to you or others: Reverse engineering or Auto-Generations of Entities in Laravel?