diff --git a/app/Filament/Pages/Statistic.php b/app/Filament/Pages/Statistic.php index 42aac0e2..df4b23ef 100644 --- a/app/Filament/Pages/Statistic.php +++ b/app/Filament/Pages/Statistic.php @@ -68,6 +68,9 @@ class Statistic extends BaseDashboard return Element::query()->whereIn('id', $arr)->orderBy('name')->pluck('name', 'id'); } }) + ->afterStateUpdated(function (callable $set) { + $set('tm_player_id', null); + }) ->preload() ->searchable() ->live() @@ -101,7 +104,7 @@ class Statistic extends BaseDashboard ->preload() ->searchable() ->options(function (Get $get) { - return StatistikoDetail::where('id_squadra_tm', $get('txodds_id'))->pluck('name', 'tm_player_id'); + return StatistikoDetail::where('txodds_id', $get('team_id'))->pluck('name', 'tm_player_id'); }) ->live(), Select::make('team_position')