Use subdomain for single route in combination with MultiTenant subdomain
Before using filament in combination with the MultiTenant solution our application was exposed on the domain:
dashboard.example.org
. Now that we are preparing a launch with MultiTenancy support from Filament we are looking for a way to catch this explicit route and let it forward to the first availble tenant instead of throwing the 404 when trying to retrieve the record. But we are not yet succesfull in doing so, wetried different solutions in terms of:
- tenantMiddleware
- bootUsing
- custom middleware
Are there any options we might have missed, or is there something we explicitly need to set in the middleware or other attempted solutions to do this, or is it simply not possible?6 Replies
Add this to the web routes.php
Just fetch the panels in the route::any method and redirect to the desired route.
Thanks for the reply, this appears to work for everything except the "/" path. I think this might be related to the filament route being defined earlier (when checked using route:list command)
It shouldn't be the case if scoping to the domain. you could try:
Unfortunately no luck there, but just tried that when I add a path to my multitenant panel (for the sake of testing a single letter) the route gets hit as expected. Now that I check my original question again I should have mentioned that I use subdomain routing, so this is why I think
I wouldn't have thoughtso. Do a
php artisan route:list
When i do that it first lists:
And at the bottom: