From 7a6338908c4276a90e000b7bb180808cadc57d59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 5 Nov 2019 23:23:54 +0100 Subject: [PATCH] Register tenant routes after other SPs are executed --- src/TenantRouteServiceProvider.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/TenantRouteServiceProvider.php b/src/TenantRouteServiceProvider.php index 6b3aca3d..1f36b35b 100644 --- a/src/TenantRouteServiceProvider.php +++ b/src/TenantRouteServiceProvider.php @@ -11,10 +11,12 @@ class TenantRouteServiceProvider extends RouteServiceProvider { public function map() { - if (file_exists(base_path('routes/tenant.php'))) { - Route::middleware(['web', 'tenancy']) - ->namespace($this->app['config']['tenancy.tenant_route_namespace'] ?? 'App\Http\Controllers') - ->group(base_path('routes/tenant.php')); - } + $this->app->booted(function () { + if (file_exists(base_path('routes/tenant.php'))) { + Route::middleware(['web', 'tenancy']) + ->namespace($this->app['config']['tenancy.tenant_route_namespace'] ?? 'App\Http\Controllers') + ->group(base_path('routes/tenant.php')); + } + }); } }