65 lines
2.2 KiB
PHP
65 lines
2.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Kontos\Schemas;
|
|
|
|
use App\Models\Konto;
|
|
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Schema;
|
|
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
|
|
|
class KontoForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
TextInput::make('konto_company')
|
|
->label('Firma')
|
|
->required(),
|
|
TextInput::make('konto_email')
|
|
->label('E-Mail')
|
|
->unique(table: Konto::class)
|
|
->required(),
|
|
TextInput::make('konto_address')
|
|
->label('Adresse')
|
|
->required(),
|
|
TextInput::make('konto_location')
|
|
->label('Ort')
|
|
->required(),
|
|
TextInput::make('konto_plz')
|
|
->label('Postleitzahl')
|
|
->required(),
|
|
PhoneInput::make('konto_phone')
|
|
->label('Telefon')
|
|
->defaultCountry('AT'),
|
|
TextInput::make('konto_country')
|
|
->label('Land')
|
|
->default('Österreich')
|
|
->required(),
|
|
TextInput::make('konto_uid_number')
|
|
->label('UID Nummer')
|
|
->rules([new VatNumber])
|
|
->required(),
|
|
TextInput::make('konto_title')
|
|
->label('Title')
|
|
->required(),
|
|
Select::make('konto_gender')
|
|
->label('Geschlecht')
|
|
->options([
|
|
'Herr' => 'Herr',
|
|
'Frau' => 'Frau',
|
|
'Non-binary' => 'Non-binary',
|
|
])
|
|
->required(),
|
|
TextInput::make('konto_first_name')
|
|
->label('Vorname')
|
|
->required(),
|
|
TextInput::make('konto_last_name')
|
|
->label('Nachname')
|
|
->required(),
|
|
]);
|
|
}
|
|
}
|