PHPackages                             romanzipp/laravel-migration-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. romanzipp/laravel-migration-generator

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

romanzipp/laravel-migration-generator
=====================================

Laravel Migration Generator

0.0.18(3y ago)75971[1 issues](https://github.com/romanzipp/Laravel-Migration-Generator/issues)MITPHPPHP ^7.2|^8.0

Since Feb 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/romanzipp/Laravel-Migration-Generator)[ Packagist](https://packagist.org/packages/romanzipp/laravel-migration-generator)[ GitHub Sponsors](https://github.com/romanzipp)[ RSS](/packages/romanzipp-laravel-migration-generator/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (9)Versions (19)Used By (0)

Laravel Migration Generator
===========================

[](#laravel-migration-generator)

[![Latest Stable Version](https://camo.githubusercontent.com/8edbeca4332410a635826052275d12a3b3ddd31734877bf51a8a3b5c6b9ee485/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726f6d616e7a6970702f6c61726176656c2d6d6967726174696f6e2d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/laravel-migration-generator)[![Total Downloads](https://camo.githubusercontent.com/dd353c53da848f3a79f8370a6a6bae244670903d83e6e2672aed8237708f28e1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726f6d616e7a6970702f6c61726176656c2d6d6967726174696f6e2d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/laravel-migration-generator)[![License](https://camo.githubusercontent.com/a8f42ede1de65a3dd45d4d3cc3b77d8d9373dae9e4f6925ec8562bcbcf735c33/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726f6d616e7a6970702f6c61726176656c2d6d6967726174696f6e2d67656e657261746f722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/romanzipp/laravel-migration-generator)[![GitHub Build Status SQLite](https://camo.githubusercontent.com/72d2ca0b66f8e11059871dbb1b2421fe3a008e2e7430f06ee6c258a0db616012/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6d616e7a6970702f4c61726176656c2d4d6967726174696f6e2d47656e657261746f722f74657374732d73716c6974652e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d53514c697465)](https://github.com/romanzipp/Laravel-Migration-Generator/actions)[![GitHub Build Status MySQL](https://camo.githubusercontent.com/373b6ace70ce54f2a6382380c02c10226b4b69c09a9f2ea642fd31aad278588e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6d616e7a6970702f4c61726176656c2d4d6967726174696f6e2d47656e657261746f722f74657374732d6d7973716c2e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d4d7953514c)](https://github.com/romanzipp/Laravel-Migration-Generator/actions)[![GitHub Build Status MariaDB](https://camo.githubusercontent.com/40cc89eb5493c5f3e7a6c9f2732f0df520c077def26a75d9017b255da48d8ca9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f726f6d616e7a6970702f4c61726176656c2d4d6967726174696f6e2d47656e657261746f722f74657374732d6d6172696164622e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265266c6162656c3d4d617269614442)](https://github.com/romanzipp/Laravel-Migration-Generator/actions)

### ⚠️ **WORK IN PROGRESS** ⚠️

[](#️-work-in-progress-️)

Generate Laravel migration files from existing databases.

Installation
------------

[](#installation)

```
composer require romanzipp/laravel-migration-generator

```

**If you use Laravel 5.5+ you are already done, otherwise continue.**

Add Service Provider to your `app.php` configuration file:

```
romanzipp\MigrationGenerator\Providers\MigrationGeneratorProvider::class,
```

Configuration
-------------

[](#configuration)

Copy configuration to config folder:

```
$ php artisan vendor:publish --provider="romanzipp\MigrationGenerator\Providers\MigrationGeneratorProvider"

```

Usage
-----

[](#usage)

```
php artisan mg:generate {--connection=}
```

You will see various new migration files prefixed with the current time &amp; date.

**Notice**: This package can't guess the order in which migrations will be created. If you've created some foreign keys in your database, be sure to re-order the migration files based on these relations.

Supported Databases
-------------------

[](#supported-databases)

- MySQL
- MariaDB
- SQLite ([Info on Datatypes](https://www.sqlite.org/datatype3.html))

Features
--------

[](#features)

- Tables
- Columns
- Column modifiers (nullable, default, ...)
- Indexes
- Foreign keys

Testing
-------

[](#testing)

There are [tests](https://github.com/romanzipp/Laravel-Migration-Generator/actions) with the following matrix.

- **PHP**
    - 7.2
    - 7.3
    - 7.4
    - 8.0
    - 8.1
    - 8.2
- **Databases**
    - SQLite
    - MySQL
    - MariaDB
- **Composer dependency versions**
    - latest
    - lowest

### SQLite

[](#sqlite)

```
./vendor/bin/phpunit

```

### MySQL / MariaDB

[](#mysql--mariadb)

*Requires a running MySQL / MariaDB server*

```
./vendor/bin/phpunit -c phpunit.mysql.xml

```

#### Provide database environment variables

[](#provide-database-environment-variables)

```
DB_HOST=127.0.0.1 DB_USERNAME=user DB_PASSWORD=secret ./vendor/bin/phpunit -c phpunit.mysql.xml

```

Known issues
------------

[](#known-issues)

- *MariaDB*: The `JSON` MySQL data type is not supported since Doctrine/DBAL interprets this as `Doctrine\DBAL\Types\TextType`
- *MySQL*: Doctrine/DBAL can't differentiate between TEXT, LONGTEXT, MEDIUMTEXT

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~65 days

Recently: every ~139 days

Total

18

Last Release

1182d ago

PHP version history (3 changes)0.0.1PHP &gt;=7.2

0.0.8PHP ^7.2

0.0.13PHP ^7.2|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/309ea408cc915d1d37b370796df57a24ec31f0b65da69f69c650c8983f9c33a6?d=identicon)[romanzipp](/maintainers/romanzipp)

---

Top Contributors

[![romanzipp](https://avatars.githubusercontent.com/u/11266773?v=4)](https://github.com/romanzipp "romanzipp (136 commits)")

---

Tags

databaselaravelphpphp7showcase

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/romanzipp-laravel-migration-generator/health.svg)

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

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[ryangjchandler/orbit

A flat-file database driver for Eloquent.

922256.2k5](/packages/ryangjchandler-orbit)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)

PHPackages © 2026

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