mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:04:04 +00:00
21 lines
649 B
PHP
21 lines
649 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Stancl\Tenancy;
|
|
|
|
use Illuminate\Foundation\Support\Providers\RouteServiceProvider;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
class TenantRouteServiceProvider extends RouteServiceProvider
|
|
{
|
|
public function map()
|
|
{
|
|
if (! in_array(request()->getHost(), $this->app['config']['tenancy.exempt_domains'] ?? [])
|
|
&& file_exists(base_path('routes/tenant.php'))) {
|
|
Route::middleware(['web', 'tenancy'])
|
|
->namespace($this->app['config']['tenant_route_namespace'] ?? 'App\Http\Controllers')
|
|
->group(base_path('routes/tenant.php'));
|
|
}
|
|
}
|
|
}
|