striped() ->columns([ IconColumn::make('sport.icon') ->label('') ->grow(false) ->color('primary') ->width(30) ->icon(fn ($record) => $record->sport->icon) ->tooltip(fn ($record) => $record->id) ->visibleFrom('lg'), TextColumn::make('id')->copyable()->alignCenter()->tooltip('Click to copy'), TextColumn::make('name') ->color('primary') ->searchable(), TextColumn::make('country.name') ->wrap() ->color('gray') ->label('Country') ->icon(fn ($record) => $record->country->icon), SelectColumn::make('level') ->width(30) ->options([ 'TOP' => 'TOP', 'MEDIUM' => 'MEDIUM', 'LOW' => 'LOW', ]), ])->filters([ SelectFilter::make('sport_id') ->label('Sport') ->default(1) ->selectablePlaceholder(false) ->options(fn () => Sport::where('is_active', 1)->pluck('name', 'id')->toArray()), SelectFilter::make('country_id') ->searchable() ->label('Countries') ->options(fn () => Country::orderBy('name')->pluck('name', 'id')->toArray()), ], layout: FiltersLayout::AboveContent) ->deferFilters(false) ->recordActions([ ActionGroup::make([ EditAction::make(), DeleteAction::make() ->tooltip('All elements connected to this group, including active events, will be deleted') ->before(function ($record) { Group::where('competition_group_id', $record->id)->delete(); Event::where('competition_group_id', $record->id)->delete(); ElementGroup::where('competition_group_id', $record->id)->delete(); CompetitionGroupProvider::where('competition_group_id', $record->id)->delete(); }) ->successNotification( Notification::make() ->success() ->title('Group deleted') ->body('The group and all relations has been deleted successfully.'), ), ])->iconButton() ->icon('phosphor-dots-three-vertical'), ]) ->headerActions([ ExportAction::make() ->modalHeading('Download Tournaments') ->color('warning') ->label('Export') ->icon('phosphor-download') ->modalDescription('This will download the TxOdds tournaments with "sport_id" and "country_id" for the sport selected.') ->modalIcon('phosphor-microsoft-excel-logo') ->exporter(CompetitionGroupExporter::class) ->columnMapping(false) ->formats([ ExportFormat::Xlsx, ExportFormat::Csv, ]), ]) ->toolbarActions([ BulkActionGroup::make([ DeleteBulkAction::make(), ]), ]); } }