Files
nutzwerte_fi4/app/Filament/Clusters/Newsletter/MailAdressens/Schemas/MailAdressenForm.php
T
2026-05-13 10:10:48 +02:00

82 lines
3.1 KiB
PHP

<?php
namespace App\Filament\Clusters\Newsletter\MailAdressens\Schemas;
use Filament\Forms\Components\DatePicker;
use Filament\Forms\Components\Radio;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
class MailAdressenForm
{
public static function configure(Schema $schema): Schema
{
return $schema
->components([
Section::make('Newsletter')
->columns(2)
->columnSpanFull()
->schema([
TextInput::make('company')
->label('Firma')
->required(),
TextInput::make('email')
->prefixIcon(Heroicon::OutlinedEnvelope)
->required(),
Select::make('mail_gruppen_id')
->required()
->label('Mail Gruppe')
->relationship(name: 'mail_gruppen', titleAttribute: 'name'),
Toggle::make('is_active'),
]),
Section::make('Persönliche Anrede')
->columns(2)
->columnSpanFull()
->schema([
Radio::make('anrede')
->required()
->options([
'Höflich' => 'Höflich',
'Freundschaftlich' => 'Freundschaftlich',
]),
Select::make('gender')
->required()
->label('Geschlecht')
->options([
'0' => 'Herr',
'1' => 'Frau',
'2' => 'Diverse',
]),
DatePicker::make('vereidigung')->required()
->prefixIcon('heroicon-o-calendar')
->native(false),
TextInput::make('first_name')
->label('Vorname')
->required(),
TextInput::make('last_name')
->label('Nachname')
->required(),
]),
Section::make('Adresse')
->columns(3)
->columnSpanFull()
->schema([
TextInput::make('address')
->label('Straße'),
TextInput::make('zip')
->label('Zip'),
TextInput::make('city')
->label('Ort'),
]),
]);
}
}
// `address` varchar(255) DEFAULT NULL,
// `zip` varchar(255) DEFAULT NULL,
// `city` varchar(255) DEFAULT NULL,
// `vereidigung` t