89 lines
3.4 KiB
PHP
89 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Kontos\Tables;
|
|
|
|
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\Support\Icons\Heroicon;
|
|
use Filament\Tables\Columns\IconColumn;
|
|
use Filament\Tables\Columns\TextColumn;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Support\Facades\Mail;
|
|
use Ysfkaya\FilamentPhoneInput\PhoneInputNumberType;
|
|
use Ysfkaya\FilamentPhoneInput\Tables\PhoneColumn;
|
|
|
|
class KontosTable
|
|
{
|
|
public static function configure(Table $table): Table
|
|
{
|
|
return $table
|
|
->columns([
|
|
// TextColumn::make('id'),
|
|
// TextColumn::make('konto_gender')->label('Geschlecht'),
|
|
// TextColumn::make('konto_title')->label('Title'),
|
|
// TextColumn::make('konto_first_name')->label('Vorname'),
|
|
// IconColumn::make('konto_agb_akzeptiert')
|
|
// ->label('AGB')
|
|
// ->boolean()
|
|
// ->trueIcon(Heroicon::OutlinedCheckBadge)
|
|
// ->falseIcon(Heroicon::OutlinedXMark),
|
|
|
|
// PhoneColumn::make('konto_phone')
|
|
// ->label('Telefon')
|
|
// ->displayFormat(PhoneInputNumberType::INTERNATIONAL),
|
|
// TextColumn::make('konto_email')
|
|
// ->copyable()
|
|
// ->copyMessage('E-Mail wurde kopiert')
|
|
// ->copyMessageDuration(1500)
|
|
// ->label('E-mail'),
|
|
|
|
TextColumn::make('konto_company')->label('Firma')
|
|
->description(fn ($record): string => $record->konto_address.', '.$record->konto_location),
|
|
|
|
TextColumn::make('konto_option.name')
|
|
->icon(Heroicon::CurrencyEuro)
|
|
// ->iconColor('success')
|
|
// ->badge()
|
|
->label('Plan')
|
|
->description(fn ($record): string => $record->konto_option->payment_plan->name),
|
|
|
|
TextColumn::make('konto_gutachten_abgeschlossen')
|
|
->size(TextSize::Large)
|
|
->weight(FontWeight::Bold)
|
|
->label('Abgeschlossen')
|
|
->color('primary')
|
|
->description('Gutachten')
|
|
->alignCenter(),
|
|
TextColumn::make('konto_gutachten_zahl')
|
|
->size(TextSize::Large)
|
|
->weight(FontWeight::Bold)
|
|
->label('Freigeschalted')
|
|
->color('success')
|
|
->description('Gutachten')
|
|
->alignCenter(),
|
|
|
|
])
|
|
->recordActions([
|
|
EditAction::make(),
|
|
Action::make('Laden')
|
|
->icon('heroicon-o-credit-card')
|
|
->color('warning')
|
|
->schema([
|
|
TextInput::make('subject')->required(),
|
|
RichEditor::make('body')->required(),
|
|
])
|
|
->action(function (array $data) {
|
|
Mail::to($this->client)
|
|
->send(new GenericEmail(
|
|
subject: $data['subject'],
|
|
body: $data['body'],
|
|
));
|
|
}),
|
|
]);
|
|
}
|
|
}
|