© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Thou Blue

How to get selected filters in filtersApplyAction?

I have 8 filters that can be applied, I want to save the applied filters in localStorage, when the user clicks on Search button. How can I do that? (I am trying to save so that the user can have previous filters selected whenever the table is viewed again(even after being logged out)).
->deferFilters()
    ->filtersApplyAction(
         function (Action $action) {
            return $action
                     ->button()
                     ->url(function (array $data) {
                           info($data);
                      })
                      ->label('Search');
          }
       )
->deferFilters()
    ->filtersApplyAction(
         function (Action $action) {
            return $action
                     ->button()
                     ->url(function (array $data) {
                           info($data);
                      })
                      ->label('Search');
          }
       )
Solution
I got the work around for this:
->filtersApplyAction(
                fn (Action $action) => $action
                    ->button()
                    ->url(function (Table $table) {
                        $filters = $table->getFilters()['dependent_filters']->getState(); // this gets all selected filters
                          // handle to save these filters on the localStorage
                    })
                    ->label('Search'),
            )
->filtersApplyAction(
                fn (Action $action) => $action
                    ->button()
                    ->url(function (Table $table) {
                        $filters = $table->getFilters()['dependent_filters']->getState(); // this gets all selected filters
                          // handle to save these filters on the localStorage
                    })
                    ->label('Search'),
            )


->filtersApplyAction(
                fn (Action $action) => $action
                    ->button()
                    ->url(function ($livewire) {
                        $filters = $livewire->tableFilters['dependent_filters']; // this gets all selected filters
                          // handle to save these filters on the localStorage
                    })
                    ->label('Search'),
            )
->filtersApplyAction(
                fn (Action $action) => $action
                    ->button()
                    ->url(function ($livewire) {
                        $filters = $livewire->tableFilters['dependent_filters']; // this gets all selected filters
                          // handle to save these filters on the localStorage
                    })
                    ->label('Search'),
            )

Both of these work
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

How to get selected records in PDF using filament 3
FilamentFFilament / ❓┊help
2y ago
How to get selected record from table in header action?
FilamentFFilament / ❓┊help
3y ago
How to get Table filters values from tables ?
FilamentFFilament / ❓┊help
3y ago
Get selected rows in Wizrd form
FilamentFFilament / ❓┊help
2y ago