With Nested Migrations, you can organize your migration files into subfolders, keeping things a bit cleaner.
This package can be installed through Composer:
$ composer require testmonitor/laravel-nested-migrationsThe package will automatically register itself.
Once loaded, you can start organizing your migration files into folders. You might want to take a look at the examples section to get a better picture.
Please note that nesting is limited to one level deep. This avoids any recursive mess.
Imagine a migration file layout like this:
database/migrations/
- 2018_09_01_180000_create_projects_table.php
- 2018_11_11_180000_create_users_table.php
- 2019_01_20_180000_create_settings_table.php
- 2019_11_12_180000_create_teams_table.php
Nothing out of the ordinary, right? But what if this list gets bigger? Like a 100 migration files? Things tend to get difficult at that stage. Usually, you'd want to categorize these files into folders and that's exactly where this package comes in.
Now, you can do this:
database/migrations/1.0
- 2018_09_01_180000_create_projects_table.php
- 2018_11_11_180000_create_users_table.php
database/migrations/1.1
- 2019_01_20_180000_create_settings_table.php
database/migrations/2.0
- 2019_11_12_180000_create_teams_table.php
A version-based migration folder layout is a great way to handle bigger apps, but you can use any name or number you'd like. Just keep in mind that the folders are sorted alphanumerically and migration files are ran through accordingly.
The package contains integration tests. You can run them using PHPUnit.
$ vendor/bin/phpunit
Refer to CHANGELOG for more information.
Refer to CONTRIBUTING for contributing details.
The MIT License (MIT). Refer to the License for more information.
