Skip to content

Commit

Permalink
[fix] fix register only enable module migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
alissn committed Sep 16, 2024
1 parent 27d90b2 commit 13ec27b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/LaravelModulesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,10 @@ protected function registerMigrations(): void
}

$this->app->resolving(Migrator::class, function (Migrator $migrator) {
$path = implode(DIRECTORY_SEPARATOR, [
$this->app['config']->get('modules.paths.modules'),
'*',
'[Dd]atabase',
'migrations',
]);

collect(glob($path, GLOB_ONLYDIR))
->each(function (string $path) use ($migrator) {
$migrator->path($path);
$migration_path = $this->app['config']->get('modules.paths.generator.migration.path');
collect(\Nwidart\Modules\Facades\Module::allEnabled())
->each(function (\Nwidart\Modules\Laravel\Module $module) use ($migration_path, $migrator) {
$migrator->path($module->getExtraPath($migration_path));
});
});
}
Expand Down

0 comments on commit 13ec27b

Please sign in to comment.