F
Filament5mo ago
morty

When using multi-tenancy, is there a way to remain on the current resource when switching tenant?

Currently, when switching tenants, it defaults back to the dashboard screen. Can it remain on the current resource instead?
2 Replies
shenntek
shenntek4mo ago
i'm interested in this as well. found were u can change it, should override the component i think: components/tenant-menu.blade.php
<x-filament::dropdown.list.item
:href="route(Route::currentRouteName(), ['tenant' => $tenant->id])"
:image="filament()->getTenantAvatarUrl($tenant)"
tag="a"
>
{{ filament()->getTenantName($tenant) }}
</x-filament::dropdown.list.item>
<x-filament::dropdown.list.item
:href="route(Route::currentRouteName(), ['tenant' => $tenant->id])"
:image="filament()->getTenantAvatarUrl($tenant)"
tag="a"
>
{{ filament()->getTenantName($tenant) }}
</x-filament::dropdown.list.item>
and from what i read it's discouraged to change views in filament. so a PR should be made.
shenntek
shenntek4mo ago
GitHub
preserve current url when switching tenant if current user can acce...
This PR adds functionality to preserve the current page/url when changing to another tenant.