Bug Description
After upgrading to Laravel 13, panels configured with ->domain() throw:
Route [filament.admin.pages.dashboard] not defined
The home redirect route and the Dashboard page route both register at GET / on the same domain. On Laravel 12 the Dashboard route overwrites the home route (last-write-wins). On Laravel 13, the home route is preserved and the Dashboard route is silently discarded (first-write-wins).
Root Cause
Laravel 13 changed RouteCollection::addToCollections() to use PHP's + array operator for domain-scoped routes:
// vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:68 (Laravel 13)
$this->routes[$method] = $domainRoutes + [$domainAndUri => $route] + ($this->routes[$method] ?? []);
The + operator preserves existing keys, so whichever route is registered first at a given domain+URI wins.
In vendor/filament/filament/routes/web.php:
- Line 143 —
Route::get('/', RedirectToHomeController::class)->name('home') registers filament.admin.home at GET /
- Lines 156–158 —
Dashboard::registerRoutes($panel) tries to register filament.admin.pages.dashboard at GET /
Since home is registered first, the Dashboard route is silently dropped. The home controller then calls route('filament.admin.pages.dashboard') to redirect, which throws.
On Laravel 12, non-domain routes used direct array assignment ($this->routes[$method][$domainAndUri] = $route) which allowed the Dashboard route to overwrite the home route. Domain routes on Laravel 12 also used direct assignment behavior. Laravel 13 changed domain routes to use the + operator, breaking this implicit ordering dependency.
Steps to Reproduce
- Create a fresh Laravel 13 project
- Install Filament v5
- Configure a panel with
->domain('admin.localhost') and ->path('')
- Create a user with
php artisan filament:new-user
- Visit
admin.localhost and log in
Expected: Dashboard loads after login
Actual: Route [filament.admin.pages.dashboard] not defined
Reproduction repo: https://github.com/ColeIsaacHarris/filament-laravel13-route-bug
This does not occur on panels without ->domain(), because non-domain routes still use direct assignment.
Workaround
Override the Dashboard's route path so it no longer conflicts with the home route:
// app/Filament/Pages/Dashboard.php
namespace App\Filament\Pages;
use Filament\Pages\Dashboard as BaseDashboard;
class Dashboard extends BaseDashboard
{
protected static string $routePath = '/dashboard';
}
Then register this custom Dashboard in the panel provider.
Possible Fix
A few options for the package:
- Change route registration order — register page routes (including Dashboard) before the
home redirect route in routes/web.php, so the Dashboard route wins under both Laravel 12 and 13 semantics.
- Give the
home route and Dashboard different paths — e.g., make the home redirect a fallback or register it only when no page claims /.
- Use a unique path for the default Dashboard — change the default
$routePath from / to /dashboard.
Versions
- PHP: 8.4
- Laravel: 13.1.1
- Filament: 5.4.1
Bug Description
After upgrading to Laravel 13, panels configured with
->domain()throw:The
homeredirect route and the Dashboard page route both register atGET /on the same domain. On Laravel 12 the Dashboard route overwrites thehomeroute (last-write-wins). On Laravel 13, thehomeroute is preserved and the Dashboard route is silently discarded (first-write-wins).Root Cause
Laravel 13 changed
RouteCollection::addToCollections()to use PHP's+array operator for domain-scoped routes:The
+operator preserves existing keys, so whichever route is registered first at a given domain+URI wins.In
vendor/filament/filament/routes/web.php:Route::get('/', RedirectToHomeController::class)->name('home')registersfilament.admin.homeatGET /Dashboard::registerRoutes($panel)tries to registerfilament.admin.pages.dashboardatGET /Since
homeis registered first, the Dashboard route is silently dropped. Thehomecontroller then callsroute('filament.admin.pages.dashboard')to redirect, which throws.On Laravel 12, non-domain routes used direct array assignment (
$this->routes[$method][$domainAndUri] = $route) which allowed the Dashboard route to overwrite thehomeroute. Domain routes on Laravel 12 also used direct assignment behavior. Laravel 13 changed domain routes to use the+operator, breaking this implicit ordering dependency.Steps to Reproduce
->domain('admin.localhost')and->path('')php artisan filament:new-useradmin.localhostand log inExpected: Dashboard loads after login
Actual:
Route [filament.admin.pages.dashboard] not definedReproduction repo: https://github.com/ColeIsaacHarris/filament-laravel13-route-bug
This does not occur on panels without
->domain(), because non-domain routes still use direct assignment.Workaround
Override the Dashboard's route path so it no longer conflicts with the
homeroute:Then register this custom Dashboard in the panel provider.
Possible Fix
A few options for the package:
homeredirect route inroutes/web.php, so the Dashboard route wins under both Laravel 12 and 13 semantics.homeroute and Dashboard different paths — e.g., make thehomeredirect a fallback or register it only when no page claims/.$routePathfrom/to/dashboard.Versions