74 lines
3.2 KiB
PHP
74 lines
3.2 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Kontos\Schemas;
|
|
|
|
use App\Models\Konto;
|
|
use Danielebarbaro\LaravelVatEuValidator\Rules\VatNumber;
|
|
use Filament\Forms\Components\RichEditor;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Schemas\Components\Tabs;
|
|
use Filament\Schemas\Components\Tabs\Tab;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Ysfkaya\FilamentPhoneInput\Forms\PhoneInput;
|
|
|
|
class KontoForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
|
|
Tabs::make('Tabs')
|
|
->tabs([
|
|
Tab::make('Rechnungsdaten')
|
|
->icon('lucide-file-pen-line')
|
|
->inlineLabel()
|
|
->schema([
|
|
TextInput::make('company')
|
|
->label('Firma/Inhaber')
|
|
->required(),
|
|
TextInput::make('uid_number')
|
|
->label('UID Nummer')
|
|
->rules([new VatNumber])
|
|
->required(),
|
|
RichEditor::make('address')->toolbarButtons([
|
|
['bold', 'italic', 'underline', 'subscript', 'superscript'],
|
|
])
|
|
->extraInputAttributes(['style' => 'min-height: 20rem; max-height: 50vh; overflow-y: auto;'])
|
|
->label('Adresse')
|
|
->required(),
|
|
])->columnSpanFull(),
|
|
Tab::make('Kontaktperson')
|
|
->icon('lucide-contact')
|
|
->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()
|
|
->prefixIcon(Heroicon::Envelope),
|
|
PhoneInput::make('phone')
|
|
->label('Telefon')
|
|
->defaultCountry('AT'),
|
|
])->columnSpanFull(),
|
|
])->columnSpanFull(),
|
|
]);
|
|
}
|
|
}
|