F
Filament10mo ago
Thijmen

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 Zeus10mo ago
are overwriting the views?
Thijmen
ThijmenOP10mo ago
No filament views are overridden
LeandroFerreira
LeandroFerreira10mo 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
ThijmenOP10mo ago
Yes
->pages([

])
->pages([

])
LeandroFerreira
LeandroFerreira10mo ago
Are you sure it is rendering the correct file? Did you create a Dashboard page?
Thijmen
ThijmenOP10mo 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
LeandroFerreira10mo ago
you should use the default view
protected static string $view = 'filament-panels::pages.dashboard';
protected static string $view = 'filament-panels::pages.dashboard';
Thijmen
ThijmenOP10mo 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
LeandroFerreira10mo ago
no, you should delete your $view attribute because there is in the default dashboard class
Thijmen
ThijmenOP10mo ago
Well when i created a page and extended the dashboard page i expected it do be good already
LeandroFerreira
LeandroFerreira10mo 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
LeandroFerreira10mo ago
You don't need to declare $view in your class
Thijmen
ThijmenOP10mo ago
Okay learned something. Thanks!
Want results from more Discord servers?
Add your server