1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 05:14:03 +00:00

Delete redundant "should not be cloned" part from shouldBeCloned()

This commit is contained in:
lukinovec 2025-05-16 16:58:27 +02:00
parent e8eb38748f
commit 228d6ca788

View file

@ -92,18 +92,12 @@ class CloneRoutesAsTenant
return $this; return $this;
} }
// todo@rename
protected function shouldBeCloned(Route $route): bool protected function shouldBeCloned(Route $route): bool
{ {
if ($this->shouldBeCloned) { if ($this->shouldBeCloned) {
return ($this->shouldBeCloned)($route); return ($this->shouldBeCloned)($route);
} }
if (Str::startsWith($route->getName(), PathTenantResolver::tenantRouteNamePrefix())) {
// The route already has the tenant route name prefix, so we don't need to clone it
return false;
}
return tenancy()->routeHasMiddleware($route, $this->cloneRoutesWithMiddleware); return tenancy()->routeHasMiddleware($route, $this->cloneRoutesWithMiddleware);
} }