1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 14:34:04 +00:00
This commit is contained in:
Samuel Štancl 2025-06-03 01:55:26 +02:00
parent ca3dfe3ef9
commit 875d6409cb

View file

@ -129,7 +129,11 @@ class CloneRoutesAsTenant
// Make the new route have the same middleware as the original route // Make the new route have the same middleware as the original route
// Add the 'tenant' middleware to the new route // Add the 'tenant' middleware to the new route
// Exclude $this->cloneRoutesWithMiddleware MW from the new route (it should only be flagged as tenant) // Exclude $this->cloneRoutesWithMiddleware MW from the new route (it should only be flagged as tenant)
$middleware = collect($action->get('middleware') ?? [])
/** @var array $middleware */
$middleware = $action->get('middleware') ?? [];
$middleware = collect($middleware)
->merge(['tenant']) // Add 'tenant' flag ->merge(['tenant']) // Add 'tenant' flag
// todo0 what if 'clone' is within some middleware group - not top level? this should be handled similarly // todo0 what if 'clone' is within some middleware group - not top level? this should be handled similarly
// to tenancy()->routeHasMiddleware() - use the same traversal depth. only issue is that in such a case, we // to tenancy()->routeHasMiddleware() - use the same traversal depth. only issue is that in such a case, we