1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 20:54:03 +00:00
This commit is contained in:
Abrar Ahmad 2022-11-25 15:16:07 +05:00
parent c0d0dc99de
commit 4c20e30fcc
4 changed files with 13 additions and 3 deletions

View file

@ -10,6 +10,7 @@ use Illuminate\Support\Facades\Route as Router;
use Stancl\Tenancy\Contracts\Feature;
use Stancl\Tenancy\Middleware;
// todo this got deleted in v4.
class UniversalRoutes implements Feature
{
public static string $middlewareGroup = 'universal';

View file

@ -27,7 +27,13 @@ class TenancyServiceProvider extends ServiceProvider
// Make sure Tenancy is stateful.
$this->app->singleton(Tenancy::class);
foreach ($this->app['config']['tenancy.features'] ?? [] as $feature) {
$this->app->resolving(Tenancy::class, function (Tenancy $tenancy, $app) {
foreach ($this->app['config']['tenancy.features'] ?? [] as $feature) {
$this->app[$feature]->bootstrap();
}
});
foreach ($this->app['config']['tenancy.tenant_unaware_features'] ?? [] as $feature) {
$this->app[$feature]->bootstrap();
}