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

Add 'Features'

This commit is contained in:
Samuel Štancl 2019-09-08 11:11:44 +02:00
parent 8c69d7847e
commit 61739dc5fc
5 changed files with 82 additions and 40 deletions

View file

@ -6,8 +6,6 @@ namespace Stancl\Tenancy;
use Illuminate\Foundation\Application;
// todo rethink integration events
/**
* @internal Class is subject to breaking changes in minor and patch versions.
*/
@ -34,6 +32,8 @@ class TenantManagerv2
{
$this->app = $app;
$this->storage = $storage;
$this->bootstrapFeatures();
}
public function createTenant(Tenant $tenant): self
@ -128,6 +128,15 @@ class TenantManagerv2
return $this;
}
protected function bootstrapFeatures(): self
{
foreach ($this->app['config']['tenancy.features'] as $feature) {
$this->app[$feature]->bootstrap();
}
return $this;
}
/**
* Return a list of TenancyBoostrappers.
*
@ -136,7 +145,7 @@ class TenantManagerv2
*/
public function tenancyBootstrappers($except = []): array
{
return array_key_diff(config('tenancy.bootstrappers'), $except);
return array_key_diff($this->app['config']['tenancy.bootstrappers'], $except);
}
/**