mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 20:54:04 +00:00
* Make universal route logic part of tbe early ID trait * Add requstHasTenant to prevent access MW, add todo@samuel * Delete PathIdentificationManager, move the used methods appropriately * Correct and refactor code related to the deleted PathIdentificationManager class * Add docblock * Fix code style (php-cs-fixer) * refactor globalStackMiddleware() * remove todos [ci skip] * refactor routeMiddleware() * revert bool assertions * revert more changes --------- Co-authored-by: PHP CS Fixer <phpcsfixer@example.com> Co-authored-by: Samuel Štancl <samuel@archte.ch>
16 lines
578 B
PHP
16 lines
578 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
use Stancl\Tenancy\Controllers\TenantAssetController;
|
|
use Stancl\Tenancy\Resolvers\PathTenantResolver;
|
|
|
|
Route::get('/tenancy/assets/{path?}', TenantAssetController::class)
|
|
->where('path', '(.*)')
|
|
->name('stancl.tenancy.asset');
|
|
|
|
Route::prefix('/{' . PathTenantResolver::tenantParameterName() . '}/')->get('/tenancy/assets/{path?}', TenantAssetController::class)
|
|
->where('path', '(.*)')
|
|
->middleware('tenant')
|
|
->name(PathTenantResolver::tenantRouteNamePrefix() . 'stancl.tenancy.asset');
|