Multi tenancy and CustomEditProfile

I have a CustomEditProfile Page
->userMenuItems([
'profile' => MenuItem::make()->url(fn (): string => EditProfile::getUrl()),
])
->userMenuItems([
'profile' => MenuItem::make()->url(fn (): string => EditProfile::getUrl()),
])
When I go to create new tenant which will go to "/new route . I will get error

Missing required parameter for [Route: filament.admin.pages.profile] [URI: {tenant}/profile] [Missing parameter: tenant].

Missing required parameter for [Route: filament.admin.pages.profile] [URI: {tenant}/profile] [Missing parameter: tenant].
Right now I found a solution do this
->userMenuItems([
'profile' => MenuItem::make()->url(fn (): string => EditProfile::getUrl())->hidden(fn (): bool => request()->routeIs('filament.admin.tenant.registration')),
->userMenuItems([
'profile' => MenuItem::make()->url(fn (): string => EditProfile::getUrl())->hidden(fn (): bool => request()->routeIs('filament.admin.tenant.registration')),
But I think there is a better way , anyone can help me ?
4 Replies
khairulazmi_
khairulazmi_OP9mo ago
I am thinking how to remove {tenant} from EditProfile but I dont know how to do it .
Tieme
Tieme9mo ago
Have you looked at this example : https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features this is working without any errors on my tenant app
khairulazmi_
khairulazmi_OP9mo ago
I could not find what i needed bump!
Pedro Victor Abreu
Thanks Good job
Want results from more Discord servers?
Add your server