Search code examples
laravellaravel-5eloquentdatabase-migrationlaravel-artisan

How to create migrations and models from existing database in Laravel


Is it possible to create migrations and models form existing database in Laravel 5? Should I do that by artisan command or maybe use special library?

How about your experience in that topic? Thanks for any help!


Solution

  • You can use https://github.com/Xethron/migrations-generator for this. But be aware that it might not create 100% usable migrations that reflect in 100% real database structure, so you should manually review migrations to make sure everything is it should be.