PHPackages                             omr\_gz/laravel-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. omr\_gz/laravel-migrations-generator

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

omr\_gz/laravel-migrations-generator
====================================

Generates Laravel Migrations from an existing database

8.x-dev(4mo ago)011MITPHP ^8.4

Since Apr 23Pushed 4mo agoCompare

[ Source](https://github.com/OmmrGAZAR315/laravel-migrations-generator)[ Packagist](https://packagist.org/packages/omr_gz/laravel-migrations-generator)[ Fund](https://www.buymeacoffee.com/kitloong)[ GitHub Sponsors](https://github.com/kitloong)[ RSS](/packages/omr-gz-laravel-migrations-generator/feed)WikiDiscussions 8.x Synced 1mo ago

READMEChangelogDependencies (10)Versions (2)Used By (1)

Laravel Migrations Generator
============================

[](#laravel-migrations-generator)

[![Style check CI](https://github.com/kitloong/laravel-migrations-generator/actions/workflows/lint.yml/badge.svg?branch=7.x)](https://github.com/kitloong/laravel-migrations-generator/actions/workflows/lint.yml/badge.svg?branch=7.x)[![Tests CI](https://github.com/kitloong/laravel-migrations-generator/actions/workflows/tests.yml/badge.svg?branch=7.x)](https://github.com/kitloong/laravel-migrations-generator/actions/workflows/tests.yml/badge.svg?branch=7.x)[![codecov](https://camo.githubusercontent.com/8b2b00aa11ddd0611413c02cb6c1306c2f969df4f284c2617db4c24a7f3bc22d/68747470733a2f2f636f6465636f762e696f2f67682f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f6272616e63682f372e782f67726170682f62616467652e7376673f746f6b656e3d55365a5244505936515a)](https://codecov.io/gh/kitloong/laravel-migrations-generator)[![Latest Stable Version](https://camo.githubusercontent.com/b206c0b13481935b39640b4ca5dd704e9b201b1f13a553f39203dbdfcedb97cd/68747470733a2f2f706f7365722e707567782e6f72672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f76)](https://packagist.org/packages/kitloong/laravel-migrations-generator)[![Total Downloads](https://camo.githubusercontent.com/fb516ac02985ef974bd616032d82fbb59743df8f188ff6af961c71de31ac0fc9/68747470733a2f2f706f7365722e707567782e6f72672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f646f776e6c6f6164733f31)](https://packagist.org/packages/kitloong/laravel-migrations-generator)[![License](https://camo.githubusercontent.com/7e053e03c10bd5e77e45ac34627e679c8d68f84ee2eb7c620340debd8d51eeb5/68747470733a2f2f706f7365722e707567782e6f72672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f6c6963656e7365)](LICENSE)

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

Documentation
-------------

[](#documentation)

Checkout the [documentation](https://kitloong.github.io/laravel-migrations-generator/usage/) for more details.

Supported Database
------------------

[](#supported-database)

Laravel Migrations Generator supports all five Laravel first-party support databases:

- MariaDB
- MySQL
- PostgreSQL
- SQL Server
- SQLite

Install
-------

[](#install)

The recommended way to install this is through composer:

```
composer require --dev kitloong/laravel-migrations-generator
```

### Laravel Setup

[](#laravel-setup)

Laravel will automatically register service provider for you.

### Lumen Setup

[](#lumen-setup)

 ExpandAuto-discovery is not available in Lumen, you need some modification on `bootstrap/app.php`.

#### Enable Facade

[](#enable-facade)

Uncomment the following line.

```
$app->withFacades();
```

#### Register Provider

[](#register-provider)

Add following line into the `Register Service Providers` section.

```
$app->register(\OmrGz\MigrationsGenerator\MigrationsGeneratorServiceProvider::class);
```

Usage
-----

[](#usage)

To generate migrations from a database, you need to have your database setup in Laravel's config (`config/database.php`).

To create migrations for all the tables, run:

```
php artisan migrate:generate
```

You can specify the tables you wish to generate using:

```
php artisan migrate:generate --tables="table1,table2,table3,table4,table5"
```

You can also ignore tables with:

```
php artisan migrate:generate --ignore="table3,table4,table5"
```

Laravel Migrations Generator will first generate all the tables, columns and indexes, and afterward 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:

```
php artisan migrate:generate --connection="connection_name"
```

### Squash Migrations

[](#squash-migrations)

By default, Generator will generate multiple migration files for each table.

You can squash all migrations into a single file with:

```
php artisan migrate:generate --squash
```

### Options

[](#options)

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

OptionsDescription[-c, --connection\[=CONNECTION\]](https://kitloong.github.io/laravel-migrations-generator/options/connection/)The database connection to use[-t, --tables\[=TABLES\]](https://kitloong.github.io/laravel-migrations-generator/options/tables/)A list of tables or views you wish to generate migrations for separated by a comma: users,posts,comments[-i, --ignore\[=IGNORE\]](https://kitloong.github.io/laravel-migrations-generator/options/ignore/)A list of tables or views you wish to ignore, separated by a comma: users,posts,comments[-p, --path\[=PATH\]](https://kitloong.github.io/laravel-migrations-generator/options/path/)Where should the file be created?[-tp, --template-path\[=TEMPLATE-PATH\]](https://kitloong.github.io/laravel-migrations-generator/options/template-path/)The location of the template for this generator[--date\[=DATE\]](https://kitloong.github.io/laravel-migrations-generator/options/date/)Migrations will be created with specified date. Views and foreign keys will be created with + 1 second. Date should be in format supported by `Carbon::parse`[--table-filename\[=TABLE-FILENAME\]](https://kitloong.github.io/laravel-migrations-generator/options/table-filename/)Define table migration filename, default pattern: `[datetime]\_create_[name]_table.php`[--view-filename\[=VIEW-FILENAME\]](https://kitloong.github.io/laravel-migrations-generator/options/table-filename/)Define view migration filename, default pattern: `[datetime]\_create_[name]_view.php`[--proc-filename\[=PROC-FILENAME\]](https://kitloong.github.io/laravel-migrations-generator/options/table-filename/)Define stored procedure filename, default pattern: `[datetime]\_create_[name]_proc.php`[--fk-filename\[=FK-FILENAME\]](https://kitloong.github.io/laravel-migrations-generator/options/table-filename/)Define foreign key migration filename, default pattern: `[datetime]\_add_foreign_keys_to_[name]_table.php`[--log-with-batch\[=LOG-WITH-BATCH\]](https://kitloong.github.io/laravel-migrations-generator/options/log-with-batch/)Log migrations with given batch number. We recommend using batch number 0 so that it becomes the first migration[--default-index-names](https://kitloong.github.io/laravel-migrations-generator/options/default-index-names/)Don't use DB index names for migrations[--default-fk-names](https://kitloong.github.io/laravel-migrations-generator/options/default-fk-names/)Don't use DB foreign key names for migrations[--use-db-collation](https://kitloong.github.io/laravel-migrations-generator/options/use-db-collation/)Generate migrations with existing DB collation[--skip-log](https://kitloong.github.io/laravel-migrations-generator/options/skip-log/)Don't log into migrations table[--skip-vendor](https://kitloong.github.io/laravel-migrations-generator/options/skip-vendor/)Don't generate vendor migrations[--skip-views](https://kitloong.github.io/laravel-migrations-generator/options/skip-views/)Don't generate views[--skip-proc](https://kitloong.github.io/laravel-migrations-generator/options/skip-proc/)Don't generate stored procedures[--squash](https://kitloong.github.io/laravel-migrations-generator/options/squash/)Generate all migrations into a single file[--with-has-table](https://kitloong.github.io/laravel-migrations-generator/options/with-has-table/)Check for the existence of a table using `hasTable`Thank You
---------

[](#thank-you)

Thanks to Bernhard Breytenbach for his great work. This package is based on .

Our Amazing Sponsor 🎉
---------------------

[](#our-amazing-sponsor-)

A huge thank you to our sponsor for supporting this project!

[ ![Vemto](https://camo.githubusercontent.com/9ebb4be648b79c67756cf4519de551ee6ac414826717ddc5e0bbf9a95d6d15fe/68747470733a2f2f76656d746f2e6170702f696d616765732f6c6f676f322e706e67)](https://vemto.app/)Want to support this project? [Become a sponsor](https://github.com/sponsors/kitloong) today!

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

[](#contributors)

[![Contributors](https://camo.githubusercontent.com/fc20b24685208b3896d15a670baa513ee24846fb45a2fb25d2b28676c0894962/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f72)](https://github.com/kitloong/laravel-migrations-generator/graphs/contributors)

License
-------

[](#license)

The Laravel Migrations Generator is open-sourced software licensed under the [MIT license](LICENSE)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance74

Regular maintenance activity

Popularity1

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.1% of commits — single point of failure

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 ~236 days

Total

2

Last Release

148d ago

Major Versions

7.x-dev → 8.x-dev2025-12-15

PHP version history (2 changes)7.x-devPHP ^8.2

8.x-devPHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1bb2ecf784051c18533c3bd1be6336f6faa968c43f7e9527f5cd6c38116b8592?d=identicon)[OmmrGAZAR315](/maintainers/OmmrGAZAR315)

---

Top Contributors

[![kitloong](https://avatars.githubusercontent.com/u/7660346?v=4)](https://github.com/kitloong "kitloong (744 commits)")[![Xethron](https://avatars.githubusercontent.com/u/1497338?v=4)](https://github.com/Xethron "Xethron (76 commits)")[![tomzx](https://avatars.githubusercontent.com/u/188960?v=4)](https://github.com/tomzx "tomzx (5 commits)")[![syamim-crane](https://avatars.githubusercontent.com/u/113884771?v=4)](https://github.com/syamim-crane "syamim-crane (5 commits)")[![ahmadsyamim](https://avatars.githubusercontent.com/u/14102774?v=4)](https://github.com/ahmadsyamim "ahmadsyamim (5 commits)")[![shemgp](https://avatars.githubusercontent.com/u/1734126?v=4)](https://github.com/shemgp "shemgp (3 commits)")[![Niyiojeyinka](https://avatars.githubusercontent.com/u/25662908?v=4)](https://github.com/Niyiojeyinka "Niyiojeyinka (3 commits)")[![viral-vector](https://avatars.githubusercontent.com/u/20329865?v=4)](https://github.com/viral-vector "viral-vector (3 commits)")[![acidjazz](https://avatars.githubusercontent.com/u/967369?v=4)](https://github.com/acidjazz "acidjazz (3 commits)")[![pablorsk](https://avatars.githubusercontent.com/u/938894?v=4)](https://github.com/pablorsk "pablorsk (2 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)")[![ldebrouwer-rmn](https://avatars.githubusercontent.com/u/6084647?v=4)](https://github.com/ldebrouwer-rmn "ldebrouwer-rmn (2 commits)")[![OmmrGAZAR315](https://avatars.githubusercontent.com/u/92094226?v=4)](https://github.com/OmmrGAZAR315 "OmmrGAZAR315 (2 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (2 commits)")[![imanghafoori1](https://avatars.githubusercontent.com/u/6961695?v=4)](https://github.com/imanghafoori1 "imanghafoori1 (1 commits)")[![Roboroads](https://avatars.githubusercontent.com/u/4398301?v=4)](https://github.com/Roboroads "Roboroads (1 commits)")[![yasming](https://avatars.githubusercontent.com/u/12103035?v=4)](https://github.com/yasming "yasming (1 commits)")[![shadywallas](https://avatars.githubusercontent.com/u/1280858?v=4)](https://github.com/shadywallas "shadywallas (1 commits)")[![hming](https://avatars.githubusercontent.com/u/3996117?v=4)](https://github.com/hming "hming (1 commits)")

---

Tags

laravelmigrationgeneratorlumenartisanmigrations

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/omr-gz-laravel-migrations-generator/health.svg)

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

###  Alternatives

[kitloong/laravel-migrations-generator

Generates Laravel Migrations from an existing database

2.9k7.4M24](/packages/kitloong-laravel-migrations-generator)[xethron/migrations-generator

Generates Laravel Migrations from an existing database

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

Generates Laravel Migrations from an existing database

362585.2k](/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

193.1k](/packages/daavelar-revengedb)

PHPackages © 2026

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