© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
4 replies
John

Can dashboard page react to filters?

Hello, I am currently building a custom dashboard that has filter, with
use HasFiltersForm;
use HasFiltersForm;
and have added some simple toggle buttons to the filter ("today", "last 7 days", "last 30 days"). that sort of thing.

The widgets are reacting with the filter with the use of
use InteractsWithPageFilters;
use InteractsWithPageFilters;


However i want to display some basic text to let the user know the date period that they selected. Since the dashboard has no blade file (that I know of), is there anywhere I can hook this information? besides putting them on individual widget itself which will clutter it with dates.

Currently what I did was adding it to the
filtersForm
filtersForm
method, however the data is not 'reactive' its working, but it is lagging behind

Here's my code

public function filtersForm(Schema $schema): Schema
    {
        $dates = DateFilterService::getStartAndEndDateByFilter($this->filters['quickFilters']);
        $selectedPeriod = $dates['startDate'] . ' to ' . $dates['endDate'];

        return $schema
            ->components([
                ToggleButtons::make('quickFilters')
                    ->label('')
                    ->inline()
                    ->options([
                        'latest' => 'Latest',
                        'last7days' => 'Last 7 Days',
                        'last30days' => 'Last 30 Days',
                        'prevmonth' => 'Previous Month',
                    ])
                    ->default('latest')
                    ->columnSpan(2),
                Text::make("Selected Period {$selectedPeriod}")
                    ->columnSpanFull(),

            ]);
    }
public function filtersForm(Schema $schema): Schema
    {
        $dates = DateFilterService::getStartAndEndDateByFilter($this->filters['quickFilters']);
        $selectedPeriod = $dates['startDate'] . ' to ' . $dates['endDate'];

        return $schema
            ->components([
                ToggleButtons::make('quickFilters')
                    ->label('')
                    ->inline()
                    ->options([
                        'latest' => 'Latest',
                        'last7days' => 'Last 7 Days',
                        'last30days' => 'Last 30 Days',
                        'prevmonth' => 'Previous Month',
                    ])
                    ->default('latest')
                    ->columnSpan(2),
                Text::make("Selected Period {$selectedPeriod}")
                    ->columnSpanFull(),

            ]);
    }
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Dashboard with filters
FilamentFFilament / ❓┊help
3y ago
clean filters from Dashboard
FilamentFFilament / ❓┊help
3y ago
filters form in dashboard
FilamentFFilament / ❓┊help
3y ago
How to get selected filters in filtersApplyAction?
FilamentFFilament / ❓┊help
2y ago