1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 16:24:04 +00:00
tenancy/src/TenantRouteServiceProvider.php

22 lines
628 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()
{
$this->app->booted(function () {
if (file_exists(base_path('routes/tenant.php'))) {
Route::middleware(['web', 'tenancy'])
->namespace($this->app['config']['tenancy.tenant_route_namespace'] ?? 'App\Http\Controllers')
->group(base_path('routes/tenant.php'));
}
});
}
}