Hiding "Dashboard" from a dashboard

Please nobody take this as whining, but as a constructive feedback: Hiding text "Dashboard" from your default dashboard really shouldn't be as hard as it has been so far. Here is my custom Dashboard page defined in the panel (I can see it's being used as the navigation name does get updated):

class Dashboard extends BasePage
{

protected static ?string $title = 'Home';
protected ?string $heading = '';
protected ?string $subheading = '';

public function getHeading(): string | Htmlable
{
return '';
}

public function getSubheading(): string | Htmlable | null
{
return '';
}

public function getTitle(): string | Htmlable
{
return '';
}
}

class Dashboard extends BasePage
{

protected static ?string $title = 'Home';
protected ?string $heading = '';
protected ?string $subheading = '';

public function getHeading(): string | Htmlable
{
return '';
}

public function getSubheading(): string | Htmlable | null
{
return '';
}

public function getTitle(): string | Htmlable
{
return '';
}
}
Ofc I can hide it with CSS, but this shouldn't be the way. Any pointers are greatly appreciated!
No description
6 Replies
wyChoong
wyChoong16mo ago
public function getHeading(): string | Htmlable
{
return '';
}
public function getHeading(): string | Htmlable
{
return '';
}
Works for me
Timster8989
Timster8989OP16mo ago
Thanks a million for chipping in! Are you on version3? As you can see from my example, I have it defined, but no help. 😦
wyChoong
wyChoong16mo ago
Yes v3 Try put a dd to make sure it’s being called Are you sure the dashboard are registered to your panel
GDG
GDG16mo ago
"Dashboard" can be overriden by creating a new file in the pages directory app/Filament/Pages/Dashboard.php You can then remove Pages::Dashboard::class from the configuration file You can then set a new title in your new Dashboard.php file or remove it if you like. Here it is in the docs https://filamentphp.com/docs/3.x/panels/dashboard#customizing-the-dashboard-page
Timster8989
Timster8989OP16mo ago
Thanks @wyChoong and @gdg1977 ! So turns out that the problem was I was extending BasePage instead of Dashboard. Duh. I clarified documentation a little on this, not to have others falling into this.
wyChoong
wyChoong16mo ago
don't think it makes a difference, likely you are just looking at the wrong page

Did you find this page helpful?