Can I have a route that can bypass multi-tenancy?
I have an admin panel with multi-tenancy. I am trying to create a billing page and add the url link of that page in a MenuItem, but I am running into this error: Missing required parameter for [Route: filament.admin.pages.billing] [URI: admin/{tenant}/billing] [Missing parameter: tenant].
This error shows up if you go to try to create a new tenant, and then click on the billing link in the user menu. Is there anyway I can have just this page not be tied to multi-tenancy?
Solution:Jump to solution
I used a workaround which consisted of creating a user observer and creating a tenant once a user is created. I then set the billingpage tenant to the first tenant of that user. Probably not the best solution, but it will work for now
3 Replies
Here is my code for the menu item. MenuItem::make()
->label('Billing')
->url(function () {
$tenant = Filament::getTenant();
return BillingPage::getUrl(['tenant' => $tenant]);
})
->icon('heroicon-o-wallet'),
Solution
I used a workaround which consisted of creating a user observer and creating a tenant once a user is created. I then set the billingpage tenant to the first tenant of that user. Probably not the best solution, but it will work for now
The only other workaround I could think of off the top of my head is to put it in a seperate panel without multitenancy.