ss ->sortable

This commit is contained in:
salam committed 2026-08-07 11:15:20 +02:00
1 parent c8cf1edaf4
commit 000f6fa046
18 files changed
+157 -106

No files matched your search

@@ -36,19 +36,23 @@ class CompetitionGroupsTable
->grow(false)
->color('primary')
->width(30)
->icon(fn ($record) => $record->sport->icon)
->tooltip(fn ($record) => $record->id)
->icon(fn($record) => $record->sport->icon)
->tooltip(fn($record) => $record->id)
->visibleFrom('lg'),
TextColumn::make('id')->copyable()->alignCenter()->tooltip('Click to copy'),
TextColumn::make('id')->copyable()->alignCenter()->tooltip('Click to copy')
->sortable(),
TextColumn::make('name')
->sortable()
->color('primary')
->searchable(),
TextColumn::make('country.name')
->wrap()
->sortable()
->color('gray')
->label('Country')
->icon(fn ($record) => $record->country->icon),
->icon(fn($record) => $record->country->icon),
SelectColumn::make('level')
->sortable()
->width(30)
->options([
'TOP' => 'TOP',
@@ -60,11 +64,11 @@ class CompetitionGroupsTable
->label('Sport')
->default(1)
->selectablePlaceholder(false)
->options(fn () => Sport::where('is_active', 1)->pluck('name', 'id')->toArray()),
->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()),
->options(fn() => Country::orderBy('name')->pluck('name', 'id')->toArray()),
], layout: FiltersLayout::AboveContent)
->deferFilters(false)
->recordActions([
@@ -64,12 +64,15 @@ class CountryResource extends Resource
->recordTitleAttribute('name')
->columns([
TextColumn::make('id')->searchable()
->sortable()
->alignCenter()->tooltip('Click to copy'),
TextColumn::make('name')
->searchable()
->sortable()
->color('primary')
->copyable(),
TextColumn::make('season_mode')
->sortable()
->badge()
->formatStateUsing(fn(string $state): string => strtoupper($state))
->color(fn(string $state): string => match ($state) {
@@ -81,10 +84,14 @@ class CountryResource extends Resource
->icon(function ($state): string {
return $state;
})->label('Flags')->size(IconSize::TwoExtraLarge),
TextColumn::make('iso3'),
TextColumn::make('cc'),
TextColumn::make('numeric'),
IconColumn::make('is_country')->alignCenter()->boolean(),
TextColumn::make('iso3')
->sortable(),
TextColumn::make('cc')
->sortable(),
TextColumn::make('numeric')
->sortable(),
IconColumn::make('is_country')->alignCenter()->boolean()
->sortable(),
])
->defaultSort('name', direction: 'asc')
@@ -36,32 +36,39 @@ class ElementsTable
->striped()
->columns([
IconColumn::make('sport.icon')
->sortable()
->label('')
->grow(false)
->width(30)
->icon(fn ($record) => $record->sport->icon)
->tooltip(fn ($record) => $record->id)
->icon(fn($record) => $record->sport->icon)
->tooltip(fn($record) => $record->id)
->visibleFrom('lg'),
TextColumn::make('id')
->sortable()
->tooltip('click to copy')
->alignCenter()
->copyable(),
TextColumn::make('name')
->sortable()
->sortable()
->searchable()
->color('primary'),
TextColumn::make('country.name')
->wrap()
->sortable()
->color('gray')
->icon(fn ($record) => $record->country->icon),
->icon(fn($record) => $record->country->icon),
TextColumn::make('element_group.competition_group_id')->label('Group Id')
->sortable()
->alignCenter()
->tooltip('click to copy')
->copyable(),
TextColumn::make('element_group.competition_group.name')->label('Group'),
TextColumn::make('element_group.competition_group.name')->label('Group')
->sortable(),
// TextColumn::make('element_group.group.name')->label('Group'),
ImageColumn::make('betsapi_image_id')
->label('Logo')
->defaultImageUrl(fn ($state) => url('https://assets.b365api.com/images/team/m/'.$state.'.png')),
->defaultImageUrl(fn($state) => url('https://assets.b365api.com/images/team/m/' . $state . '.png')),
])->filters([
SelectFilter::make('sport_id')
->label('Sport')
@@ -88,7 +95,7 @@ class ElementsTable
->query(function (Builder $query, array $data): Builder {
return $query->when(
$data['country_id'],
fn (Builder $query, $country_id) => $query->where('country_id', $country_id)
fn(Builder $query, $country_id) => $query->where('country_id', $country_id)
)->when(
$data['competition_group_id'],
function (Builder $query, $competition_group_id) {
@@ -20,11 +20,17 @@ class SofaScoreRosasTable
return $table
->defaultPaginationPageOption(50)
->columns([
TextColumn::make('ss_team_id')->label('SSId')->badge()->width('1rem'),
TextColumn::make('country.name')->label('Country'),
TextColumn::make('tournament_rosa.tournament.name')->label('Tournament'),
TextColumn::make('ss_team_name')->label('Name'),
TextColumn::make('ss_team_id')->label('SSId')->badge()->width('1rem')
->sortable(),
TextColumn::make('country.name')->label('Country')
->sortable(),
TextColumn::make('tournament_rosa.tournament.name')->label('Tournament')
->sortable(),
TextColumn::make('ss_team_name')->label('Name')
->sortable(),
TextColumn::make('updated_at')->dateTime('Y-m-d H:i:s')
->sortable()
])
->filters([
Filter::make('filters')
@@ -13,8 +13,10 @@ class SofaScoreTasksTable
{
return $table
->columns([
TextColumn::make('id')->badge()->alignCenter()->width('1rem'),
TextColumn::make('name'),
TextColumn::make('id')->badge()->alignCenter()->width('1rem')
->sortable(),
TextColumn::make('name')
->sortable(),
IconColumn::make('sport.icon')
->label('')
->grow(false)
@@ -33,18 +33,22 @@ class StatisticFixturesTable
}),
TextColumn::make('league.name')
->label('League')
->sortable()
->searchable()
->description(
fn($record) => $record->league->sofascore_category->name
),
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
TextColumn::make('starttime')->dateTime('Y-m-d H:i')
->sortable(),
TextColumn::make('home.ss_team_name')
->tooltip(fn($record) => $record->home_id)
->color('primary')
->sortable()
->searchable(),
TextColumn::make('away.ss_team_name')
->tooltip(fn($record) => $record->away_id)
->color('success')
->sortable()
->searchable(),
TextColumn::make('updated_at')->alignCenter()->date(),
])
@@ -30,7 +30,8 @@ class StatistikoDetailsTable
->searchable(
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
),
TextColumn::make('positions.name')->badge()->color('warning'),
TextColumn::make('positions.name')->badge()->color('warning')
->sortable(),
TextColumn::make('team.ss_team_name')->prefix('Team: ')->color('teal'),
TextColumn::make('team.country.name')->prefix('Country: ')->color('teal'),
TextColumn::make('birthdate')->prefix('Birthdate: '),
@@ -28,21 +28,27 @@ class StatistikoEventsTable
->striped()
->columns([
IconColumn::make('sport_id')
->sortable()
->label('')
->icon(fn(string $state): string => match ($state) {
'1' => 'icon-soccerball',
}),
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
->sortable()
->searchable(
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
),
TextColumn::make('league.name')
->sortable()
->searchable(),
TextColumn::make('home.ss_team_name')->color('info')
->sortable()
->searchable(),
TextColumn::make('away.ss_team_name')->color('success')
->sortable()
->searchable(),
TextColumn::make('starttime')->dateTime('Y-m-d H:i'),
TextColumn::make('starttime')->dateTime('Y-m-d H:i')
->sortable(),
])
->filters([
Filter::make('event_filters')
@@ -24,6 +24,7 @@ class StatistikoImportsTable
->striped()
->columns([
SelectColumn::make('data_type')
->sortable()
->native(false)
->allowOptionsHtml()
->options([
@@ -33,14 +34,17 @@ class StatistikoImportsTable
'events' => '<span class="text-green-500">Events History</span>',
]),
TextColumn::make('file_name_original')
->sortable()
->searchable()
->label('Name'),
IconColumn::make('has_run')
->label('Imported')
->sortable()
->alignCenter()
->boolean()
->falseColor('gray'),
TextColumn::make('created_at')->dateTime(),
TextColumn::make('created_at')->dateTime()
->sortable(),
])
->defaultSort('id', direction: 'desc')
@@ -16,21 +16,26 @@ class StatistikoPlayersTable
return $table
->columns([
TextColumn::make('match_id')->color('info')->icon('phosphor-copy')->copyable()
->sortable()
->searchable(
query: fn($query, $search) => $query->orWhere('match_id', (int) $search)
),
TextColumn::make('ss_player_id')
->sortable()
->label('Player Id')
->color('success')->icon('phosphor-copy')->copyable()
->searchable(
query: fn($query, $search) => $query->orWhere('ss_player_id', (int) $search)
),
TextColumn::make('details.player_name')
->sortable()
->label('Player')
->searchable()
->tooltip(fn($record) => $record->details->full_name),
TextColumn::make('event.home.ss_team_name')->searchable()->color('primary'),
TextColumn::make('event.away.ss_team_name')->searchable()->color('success'),
TextColumn::make('event.home.ss_team_name')->searchable()->color('primary')
->sortable(),
TextColumn::make('event.away.ss_team_name')->searchable()->color('success')
->sortable(),
])
// ->filters([
// Filter::make('player_filters')