1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 23:34:03 +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:
Samuel Štancl 2019-10-26 21:17:28 +02:00 committed by GitHub
parent d4beae32ca
commit bb4dc196b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -98,4 +98,5 @@ return [
'queue_database_deletion' => false, 'queue_database_deletion' => false,
'delete_database_after_tenant_deletion' => false, // delete the tenant's database after deleting the tenant 'delete_database_after_tenant_deletion' => false, // delete the tenant's database after deleting the tenant
'unique_id_generator' => Stancl\Tenancy\UniqueIDGenerators\UUIDGenerator::class, 'unique_id_generator' => Stancl\Tenancy\UniqueIDGenerators\UUIDGenerator::class,
'push_initialization_middleware_to_global_stack' => true,
]; ];

View file

@ -78,7 +78,9 @@ class TenancyServiceProvider extends ServiceProvider
__DIR__ . '/../assets/migrations/' => database_path('migrations'), __DIR__ . '/../assets/migrations/' => database_path('migrations'),
], '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 * Since tenancy is initialized in the global middleware stack, this