92 lines
3.3 KiB
PHP
92 lines
3.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Clusters\Maintenance\Resources\Events\Tables;
|
|
|
|
use App\Models\Liga;
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class EventsTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
IconColumn::make('sport_id')
|
|
->label('')
|
|
->icon(function ($record): string {
|
|
return $record->sport->icon;
|
|
}),
|
|
TextColumn::make('starttime')->dateTime('M j, Y H:i')->sortable(),
|
|
// IconColumn::make('liga_id')->label('Flag')
|
|
// ->icon(fn (string $state): Heroicon => match ($state) {
|
|
// default => Heroicon::OutlinedPencil,
|
|
// // return Liga::where('id', $state)->value('country.icon')->first();
|
|
// }),
|
|
TextColumn::make('liga.country.name'),
|
|
// TextColumn::make('liga.name')->searchable()
|
|
// ->icon(fn (string $record): string => match ($record) {
|
|
// default => $record->liga->country->icon
|
|
// }),
|
|
TextColumn::make('home.name')->searchable(),
|
|
TextColumn::make('away.name')->searchable(),
|
|
// TextColumn::make('prid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('txid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('brid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('baid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('cnid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('grid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('cgid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('hoid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('awid')
|
|
// ->numeric()
|
|
// ->sortable(),
|
|
// TextColumn::make('liga')
|
|
// ->searchable(),
|
|
|
|
// TextColumn::make('away')
|
|
// ->searchable(),
|
|
TextColumn::make('created_at')
|
|
->dateTime()
|
|
->sortable()
|
|
->toggleable(isToggledHiddenByDefault: true),
|
|
TextColumn::make('updated_at')
|
|
->dateTime()
|
|
->sortable()
|
|
->toggleable(isToggledHiddenByDefault: true),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->recordActions([
|
|
EditAction::make(),
|
|
])
|
|
->toolbarActions([
|
|
BulkActionGroup::make([
|
|
DeleteBulkAction::make(),
|
|
]),
|
|
]);
|
|
}
|
|
}
|