1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 19:34:04 +00:00

Use a nicer way to bind the current tenant

This commit is contained in:
Samuel Štancl 2019-09-07 19:46:45 +02:00
parent 27425a4360
commit 6b716e5345
6 changed files with 62 additions and 38 deletions

View file

@ -103,6 +103,9 @@ class TenancyServiceProvider extends ServiceProvider
$app, $app[StorageDriver::class], $app[DatabaseManager::class], $app[$app['config']['tenancy.unique_id_generator']] // todo
);
});
$this->app->bind(Tenant::class, function ($app) {
return $app[TenantManager::class]->currentTenant();
});
// todo foreach bootstrappers, singleton
foreach ($this->app['config']['tenancy.bootstrappers'] as $bootstrapper) {