87 lines
3.4 KiB
PHP
87 lines
3.4 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\Textarea;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Components\Section;
|
|
use Filament\Schemas\Schema;
|
|
use ToneGabes\BetterOptions\Forms\Components\RadioCards;
|
|
use ToneGabes\Filament\Icons\Enums\Phosphor;
|
|
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
|
|
|
class KontoForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
RadioCards::make('plan_id')
|
|
->label('Zahlungsplan')
|
|
->columns(3)
|
|
->options([
|
|
1 => 'Einsteiger ',
|
|
2 => 'Gelegentlich',
|
|
3 => 'Viel in Verwendung',
|
|
])
|
|
->descriptions([
|
|
1 => 'Bezahlung bei der Erstellung eines Gutachtens.',
|
|
2 => 'Zahlung Monatlich ohne Begrenzung der Gutachten.',
|
|
3 => 'Zahlung Jährlich, ohne Begrenzung der Mitarbeiter, Gutachter und Auftraggeber.',
|
|
])
|
|
->icons([
|
|
1 => Phosphor::Airplane->thin(),
|
|
2 => Phosphor::AirplaneTakeoff->thin(),
|
|
3 => Phosphor::AirplaneInFlight->thin(),
|
|
])->columnSpanFull(),
|
|
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(),
|
|
|
|
]);
|
|
}
|
|
}
|