From e665bb183da2d43ee0a04e5c291e994a7b7c7ea8 Mon Sep 17 00:00:00 2001 From: salam Date: Mon, 31 Aug 2026 09:12:44 +0200 Subject: [PATCH] reset tab --- app/Filament/Pages/Statistic.php | 8 +++++--- resources/views/filament/pages/statistic.blade.php | 11 ++++++++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 1e76cc60..ca25ab4c 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -132,10 +132,11 @@ class Statistic extends BaseDashboard // ->options(fn(Get $get) => SofaScoreTournament::with('sofascore_category')->where('sofa_score_category_id', $get('sofascore_category_id'))->pluck('name', 'tournament_id')) ->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id'))) ->placeholder('League') - ->afterStateUpdated(function (callable $set, $state) { + ->afterStateUpdated(function (callable $set) { $set('match_id', null); $set('team_id', null); $set('ss_player_id', null); + $this->dispatch('reset-tab'); }), Select::make('match_id') ->live() @@ -148,6 +149,7 @@ class Statistic extends BaseDashboard ->afterStateUpdated(function (callable $set) { $set('team_id', null); $set('ss_player_id', null); + $this->dispatch('reset-tab'); }) ->placeholder('Events'), @@ -180,6 +182,7 @@ class Statistic extends BaseDashboard }) ->afterStateUpdated(function (callable $set) { $set('ss_player_id', null); + $this->dispatch('reset-tab'); }) ->placeholder('Team'), @@ -202,7 +205,6 @@ class Statistic extends BaseDashboard 'home' => 'Home', 'away' => 'Away', ])->afterStateUpdated(function (callable $set) { - // $set('team_id', null); $set('ss_player_id', null); }), ]), @@ -258,9 +260,9 @@ class Statistic extends BaseDashboard ->default('none') ->selectablePlaceholder(false) ->afterStateUpdated(function (callable $set) { - // $set('team_id', null); $set('ss_player_id', null); $set('team_position', null); + $this->dispatch('reset-tab'); }) ->options([ 'none' => 'None', diff --git a/resources/views/filament/pages/statistic.blade.php b/resources/views/filament/pages/statistic.blade.php index 424be537..1b9167d4 100644 --- a/resources/views/filament/pages/statistic.blade.php +++ b/resources/views/filament/pages/statistic.blade.php @@ -5,11 +5,20 @@ @endphp + + {{ $this->filtersForm }} @livewire(\App\Filament\Widgets\StatsMedianAverage::class, ['filters' => $this->filters]) -
+