49 lines
1.5 KiB
PHP
49 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Multilines\Tables;
|
|
|
|
use App\Filament\Tables\Columns\BookmakerIcon;
|
|
use Filament\Actions\Action;
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class MultilinesTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->reorderRecordsTriggerAction(
|
|
fn (Action $action, bool $isReordering) => $action
|
|
->button()
|
|
->label($isReordering ? 'Disable reordering' : 'Enable reordering'),
|
|
)
|
|
->reorderable('sort')
|
|
->columns([
|
|
IconColumn::make('sport.icon')
|
|
->label('')
|
|
->width('1rem')
|
|
->icon(function ($record): string {
|
|
return $record->sport->icon;
|
|
}),
|
|
TextColumn::make('sport.name'),
|
|
TextColumn::make('matchpart.name'),
|
|
TextColumn::make('bettype.name'),
|
|
TextColumn::make('bookmaker.name'),
|
|
BookmakerIcon::make('bookmaker.icon')->label('Icon'),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->recordActions([
|
|
EditAction::make()
|
|
->mutateDataUsing(function (array $data): array {
|
|
$data['client_id'] = auth()->user()->client_id;
|
|
|
|
return $data;
|
|
}),
|
|
]);
|
|
}
|
|
}
|