32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Inhaltsverzeichnis\Tables;
|
|
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class InhaltsverzeichnisTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
// TextColumn::make('sort'),
|
|
TextColumn::make('ordnungszahl')
|
|
->getStateUsing(fn ($record): string => $record->ordnungszahl == '0' ? '' : number_format($record->ordnungszahl, 2)),
|
|
TextColumn::make('name')
|
|
->description(fn ($record): string => $record->textblock_kennung->name ?? ''),
|
|
TextColumn::make('seite')
|
|
->alignCenter()
|
|
->badge()
|
|
->color('info')
|
|
->getStateUsing(fn ($record): string => $record->seite == '0' ? '...' : $record->seite),
|
|
])
|
|
->reorderable('sort')
|
|
->recordActions([
|
|
EditAction::make()->iconButton()->color('gray'),
|
|
]);
|
|
}
|
|
}
|