From c507d0f8efda19cac04462650bafe42c3dd36b04 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Thu, 29 Jan 2026 13:28:42 +0700 Subject: [PATCH] refactor: remove `resetFilters` method and inline filter reset logic directly into the dashboard button action. --- app/Filament/Pages/Dashboard.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/app/Filament/Pages/Dashboard.php b/app/Filament/Pages/Dashboard.php index 3f7c71e..b179fe0 100644 --- a/app/Filament/Pages/Dashboard.php +++ b/app/Filament/Pages/Dashboard.php @@ -44,14 +44,11 @@ protected function getHeaderActions(): array ->label('Reset Filter') ->icon(Heroicon::XMark) ->color('danger') - ->action(fn () => $this->resetFilters()) + ->action(function () { + $this->filters['startDate'] = null; + $this->filters['endDate'] = null; + }) ->visible(fn () => ! empty($this->filters['startDate']) || ! empty($this->filters['endDate'])), ]; } - - public function resetFilters(): void - { - $this->filters['startDate'] = null; - $this->filters['endDate'] = null; - } }