Skip to content

Dashboard route silently dropped on Laravel 13 when panel uses a domain #19549

@ColeIsaacHarris

Description

@ColeIsaacHarris

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:

  1. Line 143Route::get('/', RedirectToHomeController::class)->name('home') registers filament.admin.home at GET /
  2. Lines 156–158Dashboard::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

  1. Create a fresh Laravel 13 project
  2. Install Filament v5
  3. Configure a panel with ->domain('admin.localhost') and ->path('')
  4. Create a user with php artisan filament:new-user
  5. 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:

  1. 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.
  2. Give the home route and Dashboard different paths — e.g., make the home redirect a fallback or register it only when no page claims /.
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions