Generate Laravel Migrations from an existing database

In this article we will learn how to Generate Laravel Migrations from an existing database by using a simple laravel package called migrations-generator this package also generates  Laravel Migrations from an existing database, including indexes and foreign keys so lets get started with installation

For Laravel 5 installations, add the specified packages to your composer.json

"require-dev": {
    "xethron/migrations-generator": "dev-l5",
    "way/generators": "dev-feature/laravel-five-stable",
}

You also need to point to the fork of the way/generators repo:

"repositories": [
    {
        "type": "git",
        "url": "[email protected]:jamisonvalenta/Laravel-4-Generators.git"
    }
]

Note: feature/laravel-five-stable was forked from way/generators 3.0.3 and was made Laravel 5.0 ready. Jeffrey Way has discontinued support for Laravel 5, so the other artisan generate: commands may not have been made 5.0 compatible. Investigate the artisan make: commands for substitutes, contribute to Laravel to extend generation support, or fix it and submit a PR to jamisonvalenta/feature/laravel-five-stable.

 

Recommended :  Understand Many to many Relationships in laravel
prevChapter 1 of 3

About the author

Deven Rathore

I'm Deven Rathore, a multidisciplinary & self-taught designer with 3 years of experience. I'm passionate about technology, music, coffee, traveling and everything visually stimulating. Constantly learning and experiencing new things.

Pin It on Pinterest

Shares