π¦ Installation GuideΒΆ
This guide explains how to install the Laravel Migration Generator into your Laravel or Lumen application.
β RequirementsΒΆ
PHP β₯ 8.2
Laravel 5.x β 12.x supported
One of the following PHP extensions, depending on your database:
pdo_mysql(MySQL / MariaDB)pdo_pgsql(PostgreSQL)pdo_sqlsrv(SQL Server)
Supported databases:
β MySQL 5.7, 8.0
β PostgreSQL 15
β Microsoft SQL Server 2022+
π Installation via ComposerΒΆ
Install the package in your Laravel project:
composer require n3xt0r/laravel-migration-generator --dev
βΉοΈ This package is intended as a development dependency.
Laravel will automatically discover the service provider.
π Lumen SupportΒΆ
For Lumen, you must register the service provider manually:
Open
bootstrap/app.phpAdd the following line:
$app->register(\N3XT0R\MigrationGenerator\Providers\MigrationGeneratorServiceProvider::class);
βοΈ Publish Configuration (optional)ΒΆ
If you want to customize behavior (e.g. table filters, naming), you can publish the configuration file:
php artisan vendor:publish --tag=migration-generator-config
This will create the file:
config/migration-generator.php
Inside, you can override table filters, data type mappings, and export behavior.
π³ Docker Setup (Optional)ΒΆ
This project includes a ready-to-use docker-compose.yml for local testing with multiple databases.
π§ UsageΒΆ
Simply run:
docker-compose up -d
This will start local containers for:
mysql8(MySQL 8.0)postgres(PostgreSQL 15)mssql(SQL Server 2022)
You can now run Artisan commands against each engine using environment overrides:
DB_CONNECTION=mysql php artisan migrate:regenerate
DB_CONNECTION=pgsql php artisan migrate:regenerate
DB_CONNECTION=sqlsrv php artisan migrate:regenerate
Ensure your
.envis properly configured or use inline overrides.