PHPackages                             net-results/laravel-file-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. net-results/laravel-file-generator

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

net-results/laravel-file-generator
==================================

Generates Migrations, GraphQL, Factory Files

4.3.2(5y ago)03MITPHPPHP &gt;=7.1.3

Since Mar 20Pushed 5y agoCompare

[ Source](https://github.com/DunhamPerry/laravel-migrations-generator)[ Packagist](https://packagist.org/packages/net-results/laravel-file-generator)[ RSS](/packages/net-results-laravel-file-generator/feed)WikiDiscussions 4.x Synced 2d ago

READMEChangelogDependencies (5)Versions (14)Used By (0)

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

[](#laravel-migrations-generator)

[![Build Status](https://camo.githubusercontent.com/beb69c7225ee42b2d18f696c5635ceaa2b9e452f8d4a1375d33f657c4e030f15/68747470733a2f2f7472617669732d63692e6f72672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722e737667)](https://travis-ci.org/kitloong/laravel-migrations-generator)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/138fab3a2548e00c8a58e21c905c2fdb544e96fccd60b8364465093a95f7b290/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d342e78)](https://scrutinizer-ci.com/g/kitloong/laravel-migrations-generator/)[![Latest Stable Version](https://camo.githubusercontent.com/349e298470420306d14c06eb92360778a6d3b46bf590ba05fa98669522bc83fe/68747470733a2f2f706f7365722e707567782e6f72672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f762f737461626c652e706e67)](https://packagist.org/packages/kitloong/laravel-migrations-generator)[![License](https://camo.githubusercontent.com/25029d7d83da42cc834f1244892b2c6830cee1a87b30bcf42bd38ce0b70f1ef4/68747470733a2f2f706f7365722e707567782e6f72672f6b69746c6f6f6e672f6c61726176656c2d6d6967726174696f6e732d67656e657261746f722f6c6963656e73652e706e67)](https://packagist.org/packages/kitloong/laravel-migrations-generator)

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

V4 Changes
----------

[](#v4-changes)

1. Major rewrite on `FieldGenerator` and `IndexGenerator`.
2. Fixed miscellaneous bugs.
3. Added `spatial` data type support such as `geometry`, `point`, etc.
4. Support more Laravel migration types such as `json`, `uuid`, `longText`, `year`, etc
5. Added `spatialIndex` support.
6. `timestamp` and `datetime` support precision.
7. Fixed MySQL `tinyInteger` and `boolean` issue.
8. Able generate `softDeletes`, `rememberToken`, `timestamps` types.
9. Support `set` for MySQL.
10. It is now possible to generate nullable `timestamp`
11. Removed unused classes.
12. Added UT!
13. More UT will be added to increase coverage.

This package is cloned from  and updated to support Laravel 6 and above.

Version Compatibility
---------------------

[](#version-compatibility)

LaravelVersion7.x4.x6.x4.x5.8.x4.x5.7.x4.x5.6.x4.x5.5 and belowInstall
-------

[](#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)

Auto 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

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

```

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.

OptionsDescription-c, --connection\[=CONNECTION\]The database connection to use-t, --tables\[=TABLES\]A list of Tables you wish to Generate Migrations for separated by a comma: users,posts,comments-i, --ignore\[=IGNORE\]A list of Tables you wish to ignore, separated by a comma: users,posts,comments-p, --path\[=PATH\]Where should the file be created?--defaultIndexNamesDon't use db index names for migrations--defaultFKNamesDon't use db foreign key names for migrations-tp, --templatePath\[=TEMPLATEPATH\]The location of the template for this generatorThank You
---------

[](#thank-you)

Thanks to Bernhard Breytenbach for his great work. This package is cloned from

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

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

[](#contributors)

Kit Loong

Bernhard Breytenbach ([@BBreyten](https://twitter.com/BBreyten))

License
-------

[](#license)

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

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.4% 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 ~13 days

Recently: every ~32 days

Total

12

Last Release

2098d ago

Major Versions

3.x-dev → 4.0.02020-04-01

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17463859?v=4)[Dunham Perry](/maintainers/DunhamPerry)[@DunhamPerry](https://github.com/DunhamPerry)

---

Top Contributors

[![kitloong](https://avatars.githubusercontent.com/u/7660346?v=4)](https://github.com/kitloong "kitloong (156 commits)")[![Xethron](https://avatars.githubusercontent.com/u/1497338?v=4)](https://github.com/Xethron "Xethron (76 commits)")[![DunhamPerry](https://avatars.githubusercontent.com/u/17463859?v=4)](https://github.com/DunhamPerry "DunhamPerry (9 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)")[![ldebrouwer-rmn](https://avatars.githubusercontent.com/u/6084647?v=4)](https://github.com/ldebrouwer-rmn "ldebrouwer-rmn (2 commits)")[![pablorsk](https://avatars.githubusercontent.com/u/938894?v=4)](https://github.com/pablorsk "pablorsk (2 commits)")[![sebdesign](https://avatars.githubusercontent.com/u/667144?v=4)](https://github.com/sebdesign "sebdesign (2 commits)")[![Roboroads](https://avatars.githubusercontent.com/u/4398301?v=4)](https://github.com/Roboroads "Roboroads (1 commits)")[![bktz](https://avatars.githubusercontent.com/u/1176448?v=4)](https://github.com/bktz "bktz (1 commits)")[![shadywallas](https://avatars.githubusercontent.com/u/1280858?v=4)](https://github.com/shadywallas "shadywallas (1 commits)")[![KKSzymanowski](https://avatars.githubusercontent.com/u/13980973?v=4)](https://github.com/KKSzymanowski "KKSzymanowski (1 commits)")[![spescina](https://avatars.githubusercontent.com/u/1956604?v=4)](https://github.com/spescina "spescina (1 commits)")[![hming](https://avatars.githubusercontent.com/u/3996117?v=4)](https://github.com/hming "hming (1 commits)")[![Tucker-Eric](https://avatars.githubusercontent.com/u/6483755?v=4)](https://github.com/Tucker-Eric "Tucker-Eric (1 commits)")[![chrishepner](https://avatars.githubusercontent.com/u/396592?v=4)](https://github.com/chrishepner "chrishepner (1 commits)")[![virtualize](https://avatars.githubusercontent.com/u/220102?v=4)](https://github.com/virtualize "virtualize (1 commits)")

---

Tags

laravelmigrationgeneratorlumenartisanmigrations

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/net-results-laravel-file-generator/health.svg)

```
[![Health](https://phpackages.com/badges/net-results-laravel-file-generator/health.svg)](https://phpackages.com/packages/net-results-laravel-file-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)
