fix: error when only resources are configured for multi-tenancy and the authenticated user has no tenant (#17956)

* fix: error when only resources are configured for multi-tenancy and the authenticated user has no tenant

* Update packages/panels/src/Panel/Concerns/HasRoutes.php

Signed-off-by: Dan Harrin <git@danharrin.com>

---------

Signed-off-by: Dan Harrin <git@danharrin.com>
Co-authored-by: Dan Harrin <git@danharrin.com>
This commit is contained in:
WenRenHai
2025-09-26 09:01:57 +01:00
committed by GitHub
co-authored by Dan Harrin
parent a416b95f5d
commit ea154dbadf
@@ -179,7 +179,7 @@ trait HasRoutes
return $this->getRedirectUrl($tenant);
}
if (Route::has($homeRouteName = $this->generateRouteName('home'))) {
if (((! $hasTenancy) || $tenant) && Route::has($homeRouteName = $this->generateRouteName('home'))) {
return route($homeRouteName, $tenant ? ['tenant' => $tenant] : []);
}