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

79 lines
2.9 KiB
PHP

<?php
namespace App\Filament\Resources\Kontos\Schemas;
use Alkoumi\FilamentImageRadioButton\Forms\Components\ImageRadioGroup;
use App\Models\Konto;
use App\Models\Plan;
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
class KontoForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
// Radio Cards with default features
// ImageRadioGroup::make('plan_id')
// ->animation(true)
// ->disk('promotion')
// ->label('Plan')
// ->required()
// ->columnSpanFull()
// ->options(fn () => Plan::pluck('promotion', 'id')->toArray()),
Section::make('Firma')
->inlineLabel()
->schema([
TextInput::make('company')
->label('Firma')
->required(),
TextInput::make('uid_number')
->label('UID Nummer')
->rules([new VatNumber])
->required(),
Textarea::make('address')
->label('Adresse')
->required(),
TextInput::make('country')
->label('Land')
->default('Österreich')
->required(),
])->columnSpanFull(),
Section::make('Kontaktperson')
->inlineLabel()
->schema([
TextInput::make('title')
->label('Title')
->required(),
Select::make('gender')
->label('Geschlecht')
->options([
'Herr' => 'Herr',
'Frau' => 'Frau',
'Non-binary' => 'Non-binary',
])
->required(),
TextInput::make('name')
->label('Name')
->required(),
TextInput::make('email')
->label('E-Mail')
->unique(table: Konto::class)
->required(),
PhoneInput::make('phone')
->label('Telefon')
->defaultCountry('AT'),
])->columnSpanFull(),
]);
}
}