Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
M

migrations-generator

> 编程语言
Open source

Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

360 stars0 likes0 views
WebsiteGitHub

About

Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.

Laravel Migrations Generator Laravel 5/6/7/8/9/10/11/12

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

Versioning & compatibility

Branch / Tag Laravel support PHP support Notes
laravel-12.x (12.0.0) 12.x >= 8.3 Uses doctrine/dbal:^4.0 to match the Laravel 12 / Carbon 3 ecosystem.
laravel-11.x (11.0.0) 11.x >= 8.2 Use ^11.0 for Laravel 11 apps.
laravel-10.x (10.0.0) 10.x >= 8.1 Use ^10.0 for Laravel 10 apps.
laravel-9.x (9.0.0) 9.x >= 8.2 Use ^9.0 to stay on the Laravel 9-compatible line.
Legacy 2.x (2.0.24) 5.x – 8.x ^5.6 || ^7.0 || ^8.0 Last release for older apps (ships with the legacy generator dependency).

Each Laravel major has its own maintenance branch/tag series (e.g. laravel-12.x -> 12.y.z). See doc/versions.md for the full compatibility matrix.

Contact

https://t.me/h0rnero

Laravel 6/7/8/9/10/11/12 installation

The recommended way to install this is through composer:

bash
composer require oscarafdev/migrations-generator --dev

For Laravel 12, the 12.x line now targets doctrine/dbal:^4.0, which aligns with the Carbon 3 dependency tree used by that ecosystem.

In Laravel 5.5+ the service providers will automatically get registered.

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

Changelog

Changelog for Laravel Migrations Generator

Jan 2021: v2.0.24

  • Support for Laravel 8
  • Fixed a issue where double single quotes were generated

Ago 2020: v2.0.23

  • Added support for precisions in timestamp.
  • Fixed an issue with the text type.
  • Fixed other reported bugs

May 2020: v2.0.19

  • Support for Laravel 7

Thank You

Thanks to Jeffrey Way for his amazing Laravel-4-Generators package. This package depends greatly on his work.

Contributors

Bernhard Breytenbach (@BBreyten)

Oscar Fernandez (@oscarafdev)

[email protected]

License

The Laravel Migrations Generator is open-sourced software licensed under the MIT license

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHP

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言