1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 15:34:03 +00:00

Make TenantRouteServiceProvider check if the route file exists before requiring it

This commit is contained in:
Samuel Štancl 2019-02-02 00:03:29 +01:00
parent 6b57d20c9b
commit 1547c134f1

View file

@ -9,7 +9,8 @@ class TenantRouteServiceProvider extends RouteServiceProvider
{ {
public function map() public function map()
{ {
if (! in_array(request()->getHost(), $this->app['config']['tenancy.exempt_domains'] ?? [])) { if (! in_array(request()->getHost(), $this->app['config']['tenancy.exempt_domains'] ?? [])
&& file_exists(base_path('routes/tenant.php'))) {
Route::middleware(['web', 'tenancy']) Route::middleware(['web', 'tenancy'])
->namespace($this->app['config']['tenant_route_namespace'] ?? 'App\Http\Controllers') ->namespace($this->app['config']['tenant_route_namespace'] ?? 'App\Http\Controllers')
->group(base_path('routes/tenant.php')); ->group(base_path('routes/tenant.php'));