Files
nutzwerte_fi4/app/Filament/Resources/Kontos/Tables/KontosTable.php
T
2025-09-30 14:06:03 +02:00

72 lines
2.5 KiB
PHP

<?php
namespace App\Filament\Resources\Kontos\Tables;
use App\Forms\Components\PlanRadioGroup;
use Filament\Actions\Action;
use Filament\Actions\EditAction;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\TextInput;
use Filament\Support\Enums\FontWeight;
use Filament\Support\Enums\TextSize;
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
class KontosTable
{
public static function configure(Table $table): Table
{
return $table
->columns([
TextColumn::make('company')->label('Firma')
->description(fn ($record): string => $record->address),
TextColumn::make('plan.name')
->label('Zahlungs Plan')
->description(fn ($record): string => $record->plan->payment),
TextColumn::make('guthaben')
->size(TextSize::Large)
->weight(FontWeight::Bold)
->label('Fertig')
->color('primary')
->description('Gutachten')
->alignCenter(),
TextColumn::make('abgeschlossen')
->size(TextSize::Large)
->weight(FontWeight::Bold)
->label('Kredit')
->color('success')
->description('Gutachten')
->alignCenter(),
])
->recordActions([
EditAction::make()->iconButton()->color('gray'),
Action::make('Konto')
->iconButton()
->color('gray')
->icon('lucide-plane-takeoff')
->schema([
PlanRadioGroup::make('plan_id')
->label('Plan')
->options(fn () => Plan::pluck('name', 'id')->toArray()),
// ->options([
// '1' => 'Basic',
// '2' => 'Smart',
// '3' => 'Premium',
// ]),
]),
Action::make('Bezahlen')
->iconButton()
->color('gray')
->icon('heroicon-o-credit-card')
->schema([
TextInput::make('subject')->required(),
RichEditor::make('body')->required(),
])
->action(function (array $data) {}),
]);
}
}