diff --git a/app/Filament/Resources/Events/Tables/EventsTable.php b/app/Filament/Resources/Events/Tables/EventsTable.php index 2aaaf80e..dc414d43 100644 --- a/app/Filament/Resources/Events/Tables/EventsTable.php +++ b/app/Filament/Resources/Events/Tables/EventsTable.php @@ -286,9 +286,9 @@ class EventsTable ->searchable() ->options(function (Get $get) { if ($get('country_id')) { - $res = Event::with('country')->with('group')->where('country_id', $get('country_id'))->where('starttime', '>', Carbon::now())->groupBy('group_id')->get(); + $res = Event::with('country')->where('sport_id', $get('sport_id'))->with('group')->where('country_id', $get('country_id'))->where('starttime', '>', Carbon::now())->groupBy('group_id')->get(); } else { - $res = Event::with('country')->with('group')->where('starttime', '>', Carbon::now())->groupBy('group_id')->get(); + $res = Event::with('country')->where('sport_id', $get('sport_id'))->with('group')->where('starttime', '>', Carbon::now())->groupBy('group_id')->get(); } $arr = []; foreach ($res as $val) {