dashboard filtersForm() not showing up

My dashboard extends Filament\Pages\Dashboard, on that dashboard page i have the Filament\Pages\Dashboard\Concerns\HasFiltersForm. I added the filtersForm() like this:
public function filtersForm(Form $form): Form
{
return $form
->schema([
Section::make([
DatePicker::make('from')
->label('From')
->default(Carbon::now()->subMonth()),
DatePicker::make('to')
->label('To')
->default(Carbon::now()),
]),
]);
}
public function filtersForm(Form $form): Form
{
return $form
->schema([
Section::make([
DatePicker::make('from')
->label('From')
->default(Carbon::now()->subMonth()),
DatePicker::make('to')
->label('To')
->default(Carbon::now()),
]),
]);
}
Still i don't see any form at the dashboard page.
13 Replies
Lara Zeus
Lara Zeus5mo ago
are overwriting the views?
Thijmen
Thijmen5mo ago
No filament views are overridden
LeandroFerreira
LeandroFerreira5mo ago
Did you do this? https://filamentphp.com/docs/3.x/panels/dashboard#customizing-the-dashboard-page Did you remove Pages\Dashboard::class in the panel provider?
Thijmen
Thijmen5mo ago
Yes
->pages([

])
->pages([

])
LeandroFerreira
LeandroFerreira5mo ago
Are you sure it is rendering the correct file? Did you create a Dashboard page?
Thijmen
Thijmen5mo ago
Yes i created a dashboard page. It is extending the right page also.
<x-filament-panels::page>

</x-filament-panels::page>
<x-filament-panels::page>

</x-filament-panels::page>
The custom dashboard is rendering a view with just in it.
LeandroFerreira
LeandroFerreira5mo ago
you should use the default view
protected static string $view = 'filament-panels::pages.dashboard';
protected static string $view = 'filament-panels::pages.dashboard';
Thijmen
Thijmen5mo ago
Wow that seems to work Maybe that also fixes my problem that $this->filters keeps saying null Thanks! Shouldnt this be in the docs?
LeandroFerreira
LeandroFerreira5mo ago
no, you should delete your $view attribute because there is in the default dashboard class
Thijmen
Thijmen5mo ago
Well when i created a page and extended the dashboard page i expected it do be good already
LeandroFerreira
LeandroFerreira5mo ago
GitHub
filament/packages/panels/src/Pages/Dashboard.php at 3.x · filamentp...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament
LeandroFerreira
LeandroFerreira5mo ago
You don't need to declare $view in your class
Thijmen
Thijmen5mo ago
Okay learned something. Thanks!