44 lines
1.6 KiB
PHP
44 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\MailVersands\Tables;
|
|
|
|
use Filament\Actions\EditAction;
|
|
use Filament\Tables\Columns\SelectColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Columns\ToggleColumn;
|
|
use Filament\Tables\Table;
|
|
|
|
class MailVersandsTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
TextColumn::make('name')->label('Benennung'),
|
|
SelectColumn::make('mail_gruppen_id')
|
|
->optionsRelationship(name: 'mail_gruppen', titleAttribute: 'name')
|
|
->label('Versand an Gruppe'),
|
|
SelectColumn::make('mail_vorlage_id')
|
|
->optionsRelationship(name: 'mail_vorlage', titleAttribute: 'titel')
|
|
->label('Vorlage'),
|
|
TextColumn::make('sende_zeitpunkt')->dateTime()->label('Sende Zeitpunkt'),
|
|
TextColumn::make('versand_am')->dateTime(),
|
|
SelectColumn::make('status')
|
|
->native(false)
|
|
->disabled(fn ($record): bool => $record->ist_active ? true : false)
|
|
->options([
|
|
'wartend' => '<span class="text-blue-500">Wartend</span>',
|
|
'versand' => '<span class="text-green-500">Mail Versand</span>',
|
|
])
|
|
->allowOptionsHtml(),
|
|
ToggleColumn::make('ist_active')->onColor('success'),
|
|
])
|
|
->filters([
|
|
//
|
|
])
|
|
->recordActions([
|
|
EditAction::make()->iconButton(),
|
|
]);
|
|
}
|
|
}
|