plurale event filter
This commit is contained in:
1 parent
cf55e3fac2
commit
5895f90b5b
3 files changed
+268
-277
No files matched your search
@@ -30,7 +30,6 @@ use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\VerticalAlignment;
|
||||
@@ -270,12 +269,6 @@ class EventsTable
|
||||
->hiddenLabel()
|
||||
->label('')
|
||||
->live(),
|
||||
// Toggle::make('stars_status')
|
||||
// ->hiddenLabel()
|
||||
// ->onIcon('phosphor-star-fill')
|
||||
// ->offIcon('phosphor-star')
|
||||
// ->offColor('gray')
|
||||
// ->live(),
|
||||
])
|
||||
->query(function (Builder $query, array $data): Builder {
|
||||
return $query
|
||||
@@ -316,22 +309,20 @@ class EventsTable
|
||||
$indicators = [];
|
||||
|
||||
if ($data['country_id'] ?? null) {
|
||||
$countries = $data['country_id'];
|
||||
if (is_array($countries)) {
|
||||
$countries = Country::whereIn('id', $countries)->pluck('name')->toArray();
|
||||
$countries = Country::whereIn('id', $data['country_id'])->pluck('name')->toArray();
|
||||
if (count($countries) > 1) {
|
||||
$indicators[] = Indicator::make('Countries: '.implode(', ', $countries))->removeField('country_id');
|
||||
} else {
|
||||
$indicators[] = Indicator::make('Country: '.Country::find($countries)->value('name'))->removeField('country_id');
|
||||
$indicators[] = Indicator::make('Country: '.$countries[0])->removeField('country_id');
|
||||
}
|
||||
}
|
||||
|
||||
if ($data['competition_group_id'] ?? null) {
|
||||
$competition_group_ids = $data['competition_group_id'];
|
||||
if (is_array($competition_group_ids)) {
|
||||
$countries = CompetitionGroup::whereIn('id', $competition_group_ids)->pluck('name')->toArray();
|
||||
$indicators[] = Indicator::make('Leagues: '.implode(', ', $countries))->removeField('competition_group_id');
|
||||
$competition_groups = CompetitionGroup::whereIn('id', $data['competition_group_id'])->pluck('name')->toArray();
|
||||
if (count($competition_groups) > 1) {
|
||||
$indicators[] = Indicator::make('Leagues: '.implode(', ', $competition_groups))->removeField('competition_group_id');
|
||||
} else {
|
||||
$indicators[] = Indicator::make('League: '.CompetitionGroup::find($competition_group_ids)->value('name'))->removeField('competition_group_id');
|
||||
$indicators[] = Indicator::make('League: '.$competition_groups[0])->removeField('competition_group_id');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user