mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 04:14:03 +00:00
* Update message about migrations in Install * wip * Apply fixes from StyleCI * string instead of array * Fix globalUrl binding * Simplify if condition in TenantRouteServiceProvider * Apply fixes from StyleCI * Improve PreventAccessFromTenantDomains - look into middleware subgroups * Fix typo * gatherMiddleware() instead of middleware() * Fix tests * Apply fixes from StyleCI * Update install command * Apply fixes from StyleCI * Add the PreventAccess MW to tenant routes by default
20 lines
555 B
PHP
20 lines
555 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 (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'));
|
|
}
|
|
}
|
|
}
|