KontoTextblocksTable
This commit is contained in:
1 parent
ae828ab8f5
commit
eaed59cceb
19 files changed
+532
-97
No files matched your search
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\KontoTextblocks\Tables;
|
||||
|
||||
use App\Models\TextblockKennung;
|
||||
use Filament\Actions\BulkActionGroup;
|
||||
use Filament\Actions\DeleteBulkAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Support\HtmlString;
|
||||
|
||||
class KontoTextblocksTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
TextColumn::make('textblock_kennung.name')
|
||||
->color('info')
|
||||
->wrap()
|
||||
->description(function ($record) {
|
||||
return new HtmlString($record->beschreibung);
|
||||
}),
|
||||
TextColumn::make('name')
|
||||
->weight(FontWeight::Bold)
|
||||
->wrap()
|
||||
->description(function ($record) {
|
||||
return new HtmlString($record->textblock);
|
||||
})
|
||||
->html(),
|
||||
])
|
||||
->filters([
|
||||
SelectFilter::make('textblock_kennung_id')
|
||||
->label('Textbock Art')
|
||||
->options(function (): array {
|
||||
return TextblockKennung::join('konto_textblocks', 'textblock_kennungs.id', '=', 'konto_textblocks.textblock_kennung_id')
|
||||
->pluck('textblock_kennungs.name', 'textblock_kennungs.id')->toArray();
|
||||
})
|
||||
->preload(),
|
||||
])
|
||||
->recordActions([
|
||||
EditAction::make(),
|
||||
])
|
||||
->toolbarActions([
|
||||
BulkActionGroup::make([
|
||||
DeleteBulkAction::make(),
|
||||
]),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user