Certainly! This is a common confusion with Filament 4.x. Overriding the dashboard heading isn’t immediately obvious because Filament registers its own built-in Dashboard page, and simply extending it doesn’t override the default.
The Issue
When you create your own Dashboard page in App\Filament\Pages, you end up with two Dashboard pages:
- Filament's built-in dashboard (with the title "Dashboard")
- Your custom dashboard page ("Home"), which appears as a second navigation item.
The Solution
To replace the default dashboard with your own and customize things like the heading/title, you need to unregister the built-in dashboard from Filament’s service provider, then register your own.
Step 1: Publish Filament Configuration (if needed)
If you haven’t already:
php artisan vendor:publish --tag=filament-config
Step 2: Register Your Own Dashboard Page
app/Filament/Pages/Dashboard.php
namespace App\Filament\Pages;
use Filament\Pages\Dashboard as BaseDashboard;
class Dashboard extends BaseDashboard
{
protected static ?string $title = 'Home';
protected static ?string $navigationLabel = 'Home'; // For the side nav
protected ?string $heading = 'Home'; // For the page heading
// Optionally set subtitle and description as well
// protected ?string $subheading = 'Your custom subheading here';
}
Step 3: Unregister the Built-in Dashboard
Open config/filament.php.
Find the 'pages' array. Explicitly define your pages, omitting the built-in dashboard:
'pages' => [
\App\Filament\Pages\Dashboard::class,
// other custom pages...
],
If you do not see a 'pages' section, just add it.
Step 4: Clear the Cache
Filament caches navigation—clear the cache to see your changes:
php artisan filament:cache
php artisan config:clear
php artisan route:clear
php artisan view:clear
Step 5: (Optional) Customize Navigation Group
If you want to adjust where "Home" appears in the navigation, you can use:
protected static ?string $navigationGroup = 'Main';
Summary
- Create your own
Dashboardpage. - Register it in
config/filament.phpunder'pages'. - Remove (or don’t include) the base
Filament\Pages\Dashboardfrom'pages'.
References
Example Final Class
namespace App\Filament\Pages;
use Filament\Pages\Dashboard as BaseDashboard;
class Dashboard extends BaseDashboard
{
protected static ?string $title = 'Home';
protected static ?string $navigationLabel = 'Home';
protected ?string $heading = 'Home';
}
And in config/filament.php:
'pages' => [
\App\Filament\Pages\Dashboard::class,
],
This will properly change the heading and ensure there isn’t a duplicate dashboard link.