add Custom Groups
This commit is contained in:
1 parent
c5118a4fd0
commit
6e7ebd7a9e
11 files changed
+216
-14
No files matched your search
@@ -10,6 +10,7 @@ use App\Filament\Tables\Columns\ColumnOdds;
|
||||
use App\Filament\Tables\Columns\EventColumn;
|
||||
use App\Filament\Tables\Columns\MatchIds;
|
||||
use App\Filament\Tables\Columns\TooltipOdds;
|
||||
use App\Models\ClientGroupList;
|
||||
use App\Models\CompetitionGroup;
|
||||
use App\Models\Country;
|
||||
use App\Models\Event;
|
||||
@@ -180,7 +181,7 @@ class EventsTable
|
||||
->extremePaginationLinks()
|
||||
->filters([
|
||||
Filter::make('events')
|
||||
->columns(6)->columnSpan(6)
|
||||
->columns(7)->columnSpan(7)
|
||||
->schema([
|
||||
Hidden::make('filter_alarm_green'),
|
||||
Hidden::make('filter_alarm_yellow'),
|
||||
@@ -253,6 +254,15 @@ class EventsTable
|
||||
return $arr;
|
||||
})
|
||||
->live(),
|
||||
Select::make('client_group_list_id')
|
||||
->placeholder('Custom Groups')
|
||||
->prefixIcon('phosphor-user-list')
|
||||
->searchable()
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->preload()
|
||||
->options(fn () => ClientGroupList::where('sport_id', auth()->user()->sport_id)->where('client_id', auth()->user()->client_id)->pluck('name', 'id'))
|
||||
->live(),
|
||||
|
||||
DateRangePicker::make('starttime_period')
|
||||
->columnSpan(2)
|
||||
@@ -290,6 +300,13 @@ class EventsTable
|
||||
)->when(
|
||||
$data['competition_group_id'],
|
||||
fn (Builder $query, $competition_group_id) => $query->whereIn('competition_group_id', $competition_group_id)
|
||||
|
||||
)->when(
|
||||
$data['client_group_list_id'],
|
||||
function (Builder $query, $client_group_list_id) {
|
||||
$client_group_list_ids = ClientGroupList::where('id', $client_group_list_id)->value('client_groups');
|
||||
$query->whereIn('competition_group_id', $client_group_list_ids);
|
||||
}
|
||||
)->when(
|
||||
$data['starttime_period'],
|
||||
function (Builder $query, $starttime_period) {
|
||||
@@ -448,6 +465,11 @@ class EventsTable
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['client_group_list_id'] ?? null) {
|
||||
$client_group_list_name = ClientGroupList::where('id', $data['client_group_list_id'])->value('name');
|
||||
$indicators[] = Indicator::make('Custom Group: '.$client_group_list_name)->removeField('client_group_list_id')->color('info');
|
||||
}
|
||||
|
||||
if ($data['filter_stars'] ?? null) {
|
||||
$indicators[] = Indicator::make('Filter Favorits')->removeField('filter_stars')->color('info');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user