Skip to content

Commit 4dab0c1

Browse files
authored
defer tenant route registration in TSP stub
1 parent d6d991c commit 4dab0c1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

assets/TenancyServiceProvider.stub.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,12 @@ protected function bootEvents()
120120

121121
protected function mapRoutes()
122122
{
123-
if (file_exists(base_path('routes/tenant.php'))) {
124-
Route::namespace(static::$controllerNamespace)
125-
->group(base_path('routes/tenant.php'));
126-
}
123+
$this->app->booted(function () {
124+
if (file_exists(base_path('routes/tenant.php'))) {
125+
Route::namespace(static::$controllerNamespace)
126+
->group(base_path('routes/tenant.php'));
127+
}
128+
});
127129
}
128130

129131
protected function makeTenancyMiddlewareHighestPriority()

0 commit comments

Comments
 (0)