diff --git a/assets/TenancyServiceProvider.stub.php b/assets/TenancyServiceProvider.stub.php index 1d15f418..d94703cd 100644 --- a/assets/TenancyServiceProvider.stub.php +++ b/assets/TenancyServiceProvider.stub.php @@ -120,10 +120,12 @@ protected function bootEvents() protected function mapRoutes() { - if (file_exists(base_path('routes/tenant.php'))) { - Route::namespace(static::$controllerNamespace) - ->group(base_path('routes/tenant.php')); - } + $this->app->booted(function () { + if (file_exists(base_path('routes/tenant.php'))) { + Route::namespace(static::$controllerNamespace) + ->group(base_path('routes/tenant.php')); + } + }); } protected function makeTenancyMiddlewareHighestPriority()