59 lines
2.0 KiB
PHP
59 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Supervisors\Tables;
|
|
|
|
use Filament\Actions\BulkActionGroup;
|
|
use Filament\Actions\DeleteBulkAction;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Columns\ToggleColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class SupervisorsTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('id')->badge(),
|
|
TextColumn::make('name')
|
|
->searchable(),
|
|
TextColumn::make('provider.name')
|
|
->badge()->color(fn (string $state): string => match ($state) {
|
|
'txodds' => 'danger',
|
|
'bestapi' => 'success',
|
|
'direct' => 'primary',
|
|
default => 'warning',
|
|
}),
|
|
TextColumn::make('sport_id')->label('Sport'),
|
|
TextColumn::make('bookmaker_id')->label('Book'),
|
|
TextColumn::make('sleep')->numeric(),
|
|
TextColumn::make('limit')->numeric(),
|
|
TextColumn::make('runtime')->label('Duration'),
|
|
TextColumn::make('events')->numeric(),
|
|
TextColumn::make('lastcall'),
|
|
ToggleColumn::make('is_cron')->label('Cron'),
|
|
ToggleColumn::make('is_active')->label('Status'),
|
|
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(),
|
|
]),
|
|
]);
|
|
}
|
|
}
|