Skip to content

Commit

Permalink
defer tenant route registration in TSP stub
Browse files Browse the repository at this point in the history
  • Loading branch information
stancl authored Apr 14, 2024
1 parent d6d991c commit 4dab0c1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions assets/TenancyServiceProvider.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 4dab0c1

Please sign in to comment.