mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 11:14:03 +00:00
Change command overriding
This commit is contained in:
parent
d4b5d7c2df
commit
2c4f482506
1 changed files with 7 additions and 3 deletions
|
|
@ -91,9 +91,13 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
Commands\Up::class,
|
||||
]);
|
||||
|
||||
if ($this->app['config']['tenancy.database.drop_tenant_databases_on_migrate_fresh']) {
|
||||
$this->app->extend(FreshCommand::class, fn () => new Commands\MigrateFreshOverride);
|
||||
}
|
||||
$this->app->extend(FreshCommand::class, function (FreshCommand $originalCommand) {
|
||||
if ($this->app['config']['tenancy.database.drop_tenant_databases_on_migrate_fresh']) {
|
||||
return new Commands\MigrateFreshOverride;
|
||||
}
|
||||
|
||||
return $originalCommand;
|
||||
});
|
||||
|
||||
$this->publishes([
|
||||
__DIR__ . '/../assets/config.php' => config_path('tenancy.php'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue