From 2de7cb1504cd102e2aadababc94631141ec6441c Mon Sep 17 00:00:00 2001 From: salam Date: Fri, 13 Feb 2026 13:38:10 +0100 Subject: [PATCH] wip --- app/Livewire/MapperLeft.php | 84 ++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/app/Livewire/MapperLeft.php b/app/Livewire/MapperLeft.php index d0a4fe11..07d8364e 100644 --- a/app/Livewire/MapperLeft.php +++ b/app/Livewire/MapperLeft.php @@ -98,51 +98,51 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable ->columns(4) ->schema([ FusedGroup::make([ - Select::make('country_id') - ->placeholder('Country') - ->hiddenLabel() - ->searchable() - ->preload() - ->options(function () { - $res = Event::query()->where('sport_id', auth()->user()->sport_id)->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray(); + // Select::make('country_id') + // ->placeholder('Country') + // ->hiddenLabel() + // ->searchable() + // ->preload() + // ->options(function () { + // $res = Event::query()->where('sport_id', auth()->user()->sport_id)->where('betradar_id', 0)->where('starttime', '>', Carbon::now())->groupBy('country_id')->pluck('country_id')->toArray(); - return Country::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id'); - }) - ->afterStateUpdated(function (callable $set) { - $set('competition_group_id', null); - }) - ->live(), - Select::make('competition_group_id') - ->placeholder('League') - ->hiddenLabel() - ->label('') - ->searchable() - ->options(function (Get $get) { - $map = Country::all()->pluck('name', 'id'); - $query = CompetitionGroup::where('sport_id', auth()->user()->sport_id) - ->whereHas('event', function ($query) { - $query->where('starttime', '>', now()) - ->where('betradar_id', 0); - }); + // return Country::query()->whereIn('id', $res)->orderBy('name')->pluck('name', 'id'); + // }) + // ->afterStateUpdated(function (callable $set) { + // $set('competition_group_id', null); + // }) + // ->live(), + // Select::make('competition_group_id') + // ->placeholder('League') + // ->hiddenLabel() + // ->label('') + // ->searchable() + // ->options(function (Get $get) { + // $map = Country::all()->pluck('name', 'id'); + // $query = CompetitionGroup::where('sport_id', auth()->user()->sport_id) + // ->whereHas('event', function ($query) { + // $query->where('starttime', '>', now()) + // ->where('betradar_id', 0); + // }); - if ($get('country_id') ?? null) { - $res = $query->where('country_id', $get('country_id'))->get(); - } else { - $res = $query->get(); - } - $arr = []; - foreach ($res as $value) { - if (isset($map[$value->country_id])) { - $arr[$value->id] = $map[$value->country_id].' '.$value->name; - } else { - $arr[$value->id] = $value->name; - } - } - asort($arr); + // if ($get('country_id') ?? null) { + // $res = $query->where('country_id', $get('country_id'))->get(); + // } else { + // $res = $query->get(); + // } + // $arr = []; + // foreach ($res as $value) { + // if (isset($map[$value->country_id])) { + // $arr[$value->id] = $map[$value->country_id].' '.$value->name; + // } else { + // $arr[$value->id] = $value->name; + // } + // } + // asort($arr); - return $arr; - }) - ->live(), + // return $arr; + // }) + // ->live(), ])->columnSpan(2), DateRangePicker::make('starttime_period') ->displayFormat('d M Y')