1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 20:44:03 +00:00
tenancy/src/TenantRouteServiceProvider.php
Samuel Štancl 97ec172fd4
Specify namespace on global functions (fix #35) (#36)
* Specify namespace on global functions (fix #35)

* merge

* Revert some \ additions

* small fixes
2019-04-24 17:33:41 +02:00

19 lines
624 B
PHP

<?php
namespace Stancl\Tenancy;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider;
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'));
}
}
}