mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:04:02 +00:00
[2.2.0] Make tenancy initialization in global MW stack optional (#203)
* Make tenancy initialization in global MW stack optional * update config key
This commit is contained in:
parent
d4beae32ca
commit
bb4dc196b0
2 changed files with 4 additions and 1 deletions
|
|
@ -98,4 +98,5 @@ return [
|
|||
'queue_database_deletion' => false,
|
||||
'delete_database_after_tenant_deletion' => false, // delete the tenant's database after deleting the tenant
|
||||
'unique_id_generator' => Stancl\Tenancy\UniqueIDGenerators\UUIDGenerator::class,
|
||||
'push_initialization_middleware_to_global_stack' => true,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
__DIR__ . '/../assets/migrations/' => database_path('migrations'),
|
||||
], 'migrations');
|
||||
|
||||
$this->app->make(Kernel::class)->prependMiddleware(Middleware\InitializeTenancy::class);
|
||||
if ($this->app['config']['tenancy.push_initialization_middleware_to_global_stack'] ?? true) {
|
||||
$this->app->make(Kernel::class)->prependMiddleware(Middleware\InitializeTenancy::class);
|
||||
}
|
||||
|
||||
/*
|
||||
* Since tenancy is initialized in the global middleware stack, this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue