1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 05:54:05 +00:00

Change command overriding

This commit is contained in:
lukinovec 2022-10-17 12:46:41 +02:00
parent d4b5d7c2df
commit 2c4f482506

View file

@ -91,9 +91,13 @@ class TenancyServiceProvider extends ServiceProvider
Commands\Up::class, Commands\Up::class,
]); ]);
if ($this->app['config']['tenancy.database.drop_tenant_databases_on_migrate_fresh']) { $this->app->extend(FreshCommand::class, function (FreshCommand $originalCommand) {
$this->app->extend(FreshCommand::class, fn () => new Commands\MigrateFreshOverride); if ($this->app['config']['tenancy.database.drop_tenant_databases_on_migrate_fresh']) {
} return new Commands\MigrateFreshOverride;
}
return $originalCommand;
});
$this->publishes([ $this->publishes([
__DIR__ . '/../assets/config.php' => config_path('tenancy.php'), __DIR__ . '/../assets/config.php' => config_path('tenancy.php'),