Files
nuhodds_fi4/app/Filament/Resources/Bookmakers/Tables/BookmakersTable.php
T
2025-12-12 07:35:03 +01:00

56 lines
1.8 KiB
PHP

<?php
namespace App\Filament\Resources\Bookmakers\Tables;
use Filament\Actions\EditAction;
use Filament\Tables\Columns\IconColumn;
use Filament\Tables\Columns\ImageColumn;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Columns\ToggleColumn;
use Filament\Tables\Filters\TernaryFilter;
use Filament\Tables\Table;
class BookmakersTable
{
public static function configure(Table $table): Table
{
return $table
->striped()
->columns([
TextColumn::make('name')
->searchable(),
IconColumn::make('icon')
->trueColor('black')
->size('2xl')
->icon(function ($record): string {
return 'bkm-'.$record->icon;
}),
ImageColumn::make('image')
->imageHeight(30)
->imageWidth(110),
TextColumn::make('baid')
->numeric()
->sortable(),
TextColumn::make('txid')
->numeric()
->sortable(),
ToggleColumn::make('txso')->offColor('gray'),
ToggleColumn::make('txot')->offColor('gray'),
ToggleColumn::make('betsapi')->offColor('gray'),
ToggleColumn::make('direct')->offColor('gray'),
ToggleColumn::make('is_active')->offColor('gray'),
])
->defaultSort('name')
->filters([
TernaryFilter::make('txso'),
TernaryFilter::make('txot'),
TernaryFilter::make('betsapi'),
TernaryFilter::make('direct'),
TernaryFilter::make('is_active')->default(true),
])
->recordActions([
EditAction::make(),
]);
}
}