Removing tenant parameter and middleware for SimplePage
Hi!
In the app I'm building, users can belong to multiple tenants.
I'm tracking their current organization via a
currentOrganization
relationship on the User model.
If a user's current org is empty, I'd like to redirect them to a page, /current-organization
, where they can select which of their organizations they'd like to administer. I'm doing this via middleware:
and /current-organization
:
This page is registered via the pages
method in the Panel Provider.
There are two problems:
1. The route above still appears in the {tenant}
namespace.
php artisan routes:list | grep current
shows: GET|HEAD myurl.test/{tenant}/current-organization ... filament.admin.pages.current-organization › App\Filament\Pages\CurrentOrganization
2. It gets stuck in a redirect loop despite explicitly disabling the offending middleware.
Is this a bug, or am I missing something? How can I remove it from the tenant routes? And how can I disable the middleware?1 Reply
For the middleware, can you dd to see if it runs the middleware, if it does then check your
if
checking
You can also run artisan route:list -v
to see the middleware tied to the route