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 57% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity61

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

1279d 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://avatars.githubusercontent.com/u/11266773?v=4)[Roman Zipp](/maintainers/romanzipp)[@romanzipp](https://github.com/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-medialibrary

Associate files with Eloquent models

6.2k45.4M704](/packages/spatie-laravel-medialibrary)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M319](/packages/laravel-ai)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

731189.9k16](/packages/tallstackui-tallstackui)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[iazaran/smart-cache

Smart Cache is a caching optimization package designed to enhance the way your Laravel application handles data caching. It intelligently manages large data sets by compressing, chunking, or applying other optimization strategies to keep your application performant and efficient.

21114.2k](/packages/iazaran-smart-cache)[forjedio/inertia-table

Backend-driven dynamic tables for Laravel + Inertia.js

272.0k](/packages/forjedio-inertia-table)

PHPackages © 2026

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