You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Filament Multi-Tenancy: Tenant Switcher Dropdown Not Showing All Available Tenants
Problem Description
I'm experiencing an issue with Filament's tenant switcher dropdown where it doesn't display all available tenants for the authenticated user. The dropdown appears but shows limited or no tenant options, even though the user has access to multiple organizations.
publicfunctionpanel(Panel$panel): Panel
{
return$panel
->default()
->id('admin')
->path('admin')
->login()
->tenant(Organization::class, slugAttribute: 'slug')
->tenantRegistration(RegisterOrganization::class)
->tenantMenu(); // or ->tenantMenu(false) for custom implementation
}
Database Structure
users table with standard fields
organizations table with id, name, slug, created_at, updated_at
organization_user pivot table with id, organization_id, user_id, created_at, updated_at
What I've Verified
✅ Database relationships work correctly: User::find(1)->organizations returns all expected organizations
✅ getTenants() method works: Returns the correct collection of organizations
✅ Pivot table has correct data: User is properly associated with multiple organizations
✅ Organization model methods: All required methods (getId(), getCurrentTenantLabel(), etc.) are implemented
✅ Route key configuration: Using slug as route key with proper getRouteKey() method
Testing Results
When I test the getTenants() method directly:
$user = User::find(1);
dd($user->getTenants(Filament::getCurrentPanel()));
// Returns: Collection with 6 organizations
But the tenant switcher dropdown in the UI doesn't show these organizations.
Questions
Are there any known issues with Filament v4.0's tenant switcher dropdown not displaying all available tenants?
Could this be related to JavaScript/Livewire state management on the frontend in v4.0?
Are there any breaking changes in Filament v4.0 multi-tenancy compared to v3.x that I might have missed?
Should I implement a custom tenant switcher instead of using the default one in v4.0?
Are there any Laravel 12.x compatibility issues with Filament v4.0 multi-tenancy?
Additional Context
This seems to be related to similar issues reported in earlier versions. I've tried clearing all caches (php artisan optimize:clear) and restarting the development server, but the issue persists.
Since this is Filament v4.0 with Laravel 12.x, I'm wondering if there are any version-specific considerations or recent changes that might affect the tenant switcher functionality.
Any insights or suggestions would be greatly appreciated!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Other
Package Version
v4.0.0
How can we help you?
Filament Multi-Tenancy: Tenant Switcher Dropdown Not Showing All Available Tenants
Problem Description
I'm experiencing an issue with Filament's tenant switcher dropdown where it doesn't display all available tenants for the authenticated user. The dropdown appears but shows limited or no tenant options, even though the user has access to multiple organizations.
Environment
"filament/filament": "^4.0"
)"laravel/framework": "^12.0"
)"php": "^8.2"
)Current Setup
User Model (HasTenants implementation)
Organization Model (Tenant Model)
AdminPanelProvider Configuration
Database Structure
users
table with standard fieldsorganizations
table withid
,name
,slug
,created_at
,updated_at
organization_user
pivot table withid
,organization_id
,user_id
,created_at
,updated_at
What I've Verified
User::find(1)->organizations
returns all expected organizationsgetId()
,getCurrentTenantLabel()
, etc.) are implementedslug
as route key with propergetRouteKey()
methodTesting Results
When I test the
getTenants()
method directly:But the tenant switcher dropdown in the UI doesn't show these organizations.
Questions
Additional Context
This seems to be related to similar issues reported in earlier versions. I've tried clearing all caches (
php artisan optimize:clear
) and restarting the development server, but the issue persists.Since this is Filament v4.0 with Laravel 12.x, I'm wondering if there are any version-specific considerations or recent changes that might affect the tenant switcher functionality.
Any insights or suggestions would be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions