joshbrw / laravel-module-migrations
Adds functionality for running migrations from other modules.
Installs: 3 660
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.2
- illuminate/database: 5.8.*
- illuminate/support: 5.8.*
- nwidart/laravel-modules: 5.*
README
Provides a Trait that can be used on migrations with Laravel Modules to ensure that a table from another Module exists. This solves any cross-module table dependency issues.
Installation
-
Publish the config to
config/module-migrations.php
by running:php artisan vendor:publish --provider="Joshbrw\LaravelModuleMigrations\LaravelModuleMigrationsServiceProvider"
-
Write your table definitions within this config file. This config file should define the tables that can be created, the module that their migrations exist in and any migrations that should be ran to create this table.
-
In any migrations that require tables created in other modules,
use Joshbrw\LaravelModuleMigrations\Traits\ModuleMigrator
. -
Use
$this->ensureTableExists('tableName');
wherever you want the tables to be created.