PHPackages                             rafahsborges/migrations-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. rafahsborges/migrations-generator

ActiveLibrary[Database &amp; ORM](/categories/database)

rafahsborges/migrations-generator
=================================

Generates Laravel Migrations from an existing database

3.0.0(2y ago)095MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Aug 9Pushed 2y agoCompare

[ Source](https://github.com/rafahsborges/migrations-generator)[ Packagist](https://packagist.org/packages/rafahsborges/migrations-generator)[ RSS](/packages/rafahsborges-migrations-generator/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (7)Versions (8)Used By (0)

Laravel Migrations Generator Laravel 10 +
=========================================

[](#laravel-migrations-generator-laravel-10-)

Generate Laravel Migrations from an existing database, including indexes and foreign keys!

Contact
=======

[](#contact)

Laravel 10 installation
-----------------------

[](#laravel-10-installation)

The recommended way to install this is through composer:

```
composer require rafahsborges/migrations-generator --dev
```

In Laravel 10 the service providers will automatically get registered.

Usage
-----

[](#usage)

To generate migrations from a database, you need to have your database setup in Laravel's Config.

Run `php artisan migrate:generate` to create migrations for all the tables, or you can specify the tables you wish to generate using `php artisan migrate:generate table1,table2,table3,table4,table5`. You can also ignore tables with `--ignore="table3,table4,table5"`

Laravel Migrations Generator will first generate all the tables, columns and indexes, and afterwards setup all the foreign key constraints. So make sure you include all the tables listed in the foreign keys so that they are present when the foreign keys are created.

You can also specify the connection name if you are not using your default connection with `--connection="connection_name"`

Run `php artisan help migrate:generate` for a list of options.

Check out Chung Tran's blog post for a quick step by step introduction: [Generate Migrations from an existing database in Laravel 4](http://codingtip.blogspot.com/2014/04/laravel-4-generate-migration-existed-dabase-laravel-4.html)

Changelog
---------

[](#changelog)

Changelog for Laravel Migrations Generator

### Ago 2023: v3.0.0

[](#ago-2023-v300)

- Minimum supported versions: PHP 8.0 and Laravel 10

Thank You
---------

[](#thank-you)

Thanks to Jeffrey Way and OscarDev for their unique packages. This package depends significantly on their work.

Contributors
------------

[](#contributors)

Rafah S Borges ([@rafahsborges](https://www.linkedin.com/in/rafael-souza-borges-92995426/))

License
-------

[](#license)

The Laravel Migrations Generator is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

6

Last Release

1058d ago

Major Versions

2.0.29 → 3.0.02023-08-10

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16123060?v=4)[RAFAEL SOUZA BORGES](/maintainers/rafahsborges)[@rafahsborges](https://github.com/rafahsborges)

---

Top Contributors

[![Xethron](https://avatars.githubusercontent.com/u/1497338?v=4)](https://github.com/Xethron "Xethron (76 commits)")[![oscarafdev](https://avatars.githubusercontent.com/u/57678138?v=4)](https://github.com/oscarafdev "oscarafdev (52 commits)")[![rafahsborges](https://avatars.githubusercontent.com/u/16123060?v=4)](https://github.com/rafahsborges "rafahsborges (14 commits)")[![tomzx](https://avatars.githubusercontent.com/u/188960?v=4)](https://github.com/tomzx "tomzx (5 commits)")[![shemgp](https://avatars.githubusercontent.com/u/1734126?v=4)](https://github.com/shemgp "shemgp (3 commits)")[![viral-vector](https://avatars.githubusercontent.com/u/20329865?v=4)](https://github.com/viral-vector "viral-vector (3 commits)")[![akalongman](https://avatars.githubusercontent.com/u/423050?v=4)](https://github.com/akalongman "akalongman (2 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (2 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (2 commits)")[![ldebrouwer-rmn](https://avatars.githubusercontent.com/u/6084647?v=4)](https://github.com/ldebrouwer-rmn "ldebrouwer-rmn (2 commits)")[![cristianoteles](https://avatars.githubusercontent.com/u/215228?v=4)](https://github.com/cristianoteles "cristianoteles (2 commits)")[![pablorsk](https://avatars.githubusercontent.com/u/938894?v=4)](https://github.com/pablorsk "pablorsk (2 commits)")[![spescina](https://avatars.githubusercontent.com/u/1956604?v=4)](https://github.com/spescina "spescina (1 commits)")[![tjventurini](https://avatars.githubusercontent.com/u/4708070?v=4)](https://github.com/tjventurini "tjventurini (1 commits)")[![Tucker-Eric](https://avatars.githubusercontent.com/u/6483755?v=4)](https://github.com/Tucker-Eric "Tucker-Eric (1 commits)")[![virtualize](https://avatars.githubusercontent.com/u/220102?v=4)](https://github.com/virtualize "virtualize (1 commits)")[![wilo-ahadi](https://avatars.githubusercontent.com/u/31555614?v=4)](https://github.com/wilo-ahadi "wilo-ahadi (1 commits)")[![peeto](https://avatars.githubusercontent.com/u/12824230?v=4)](https://github.com/peeto "peeto (1 commits)")[![AntiPaste](https://avatars.githubusercontent.com/u/4379220?v=4)](https://github.com/AntiPaste "AntiPaste (1 commits)")[![bktz](https://avatars.githubusercontent.com/u/1176448?v=4)](https://github.com/bktz "bktz (1 commits)")

---

Tags

laravelmigrationgeneratorartisanmigrations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rafahsborges-migrations-generator/health.svg)

```
[![Health](https://phpackages.com/badges/rafahsborges-migrations-generator/health.svg)](https://phpackages.com/packages/rafahsborges-migrations-generator)
```

###  Alternatives

[kitloong/laravel-migrations-generator

Generates Laravel Migrations from an existing database

2.9k8.2M34](/packages/kitloong-laravel-migrations-generator)[xethron/migrations-generator

Generates Laravel Migrations from an existing database

3.4k3.3M25](/packages/xethron-migrations-generator)[oscarafdev/migrations-generator

Generates Laravel Migrations from an existing database

365594.1k](/packages/oscarafdev-migrations-generator)[daavelar/revengedb

RevengeDb provides an artisan command to make a reverse engineer of the database, generating automatically the migrations for you

203.1k](/packages/daavelar-revengedb)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
