© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•5d ago•
1 reply
maxvankuik

Dynamic slugAttribute for tenant and tenantDomain, bad?

Panels5️⃣v5
I wanted to have the option for tenants to setup a custom domain. So I added some logic to wether the slugAttribute should be uuid or domain. And all is working fine. Except when I cache the routes on production.

Is it a bad idea to have this dynamic in a PanelProvider?

⁨
$panel
...
->tenantDomain($usingTenantDomain ? '{tenant:domain}' : null)
->tenant(Tenant::class, $usingTenantDomain ? 'domain' : 'uuid');
$panel
...
->tenantDomain($usingTenantDomain ? '{tenant:domain}' : null)
->tenant(Tenant::class, $usingTenantDomain ? 'domain' : 'uuid');
⁩

It works. But it does not work when we cache the routes.

What is the suggested approach here? Split up in two panels? Stick to one option? Stop caching routes for the panel?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Equivalent of `slugAttribute` for resources
FilamentFFilament / ❓┊help
8mo ago
Redirects when using tenantDomain
FilamentFFilament / ❓┊help
7mo ago
Multi Tenancy - Fixed subdomain and dynamic tenant domain
FilamentFFilament / ❓┊help
13mo ago
Removing tenant parameter and middleware for SimplePage
FilamentFFilament / ❓┊help
3y ago