- Gäste: Markierungen, Aufenthalte & Umsatz, Stammgast-/Einwilligungsfilter, CSV-Export, Anonymisierung (manuell + automatisch nach Aufbewahrungsfrist) - Werbe-Einwilligung per Double-Opt-in aus dem Anfrageformular, signierte Bestätigungs-/Abmeldelinks - Bewertungen: automatische Einladung nach Abreise, Bewertungsformular mit Kategorien und internem Feedback, Freigabe und öffentliche Antwort im Admin - Konzept: Rollen, Inhalte, Customer Voice, Architektur Portal-Sync/Buchungshoheit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
2.6 KiB
PHP
56 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Guests\Schemas;
|
|
|
|
use App\Models\Guest;
|
|
use Filament\Forms\Components\Select;
|
|
use Filament\Forms\Components\TagsInput;
|
|
use Filament\Forms\Components\Textarea;
|
|
use Filament\Forms\Components\TextInput;
|
|
use Filament\Infolists\Components\TextEntry;
|
|
use Filament\Schemas\Components\Section;
|
|
use Filament\Schemas\Schema;
|
|
|
|
class GuestForm
|
|
{
|
|
public static function configure(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->columns(3)
|
|
->components([
|
|
Section::make('Kontakt')
|
|
->columnSpan(2)
|
|
->columns(2)
|
|
->schema([
|
|
TextInput::make('first_name')->label('Vorname')->required()->maxLength(255),
|
|
TextInput::make('last_name')->label('Nachname')->required()->maxLength(255),
|
|
TextInput::make('email')->label('E-Mail')->email()->required()->maxLength(255),
|
|
TextInput::make('phone')->label('Telefon')->tel()->maxLength(50),
|
|
TextInput::make('street')->label('Straße')->maxLength(255),
|
|
TextInput::make('postal_code')->label('PLZ')->maxLength(20),
|
|
TextInput::make('city')->label('Ort')->maxLength(255),
|
|
Select::make('country')
|
|
->label('Land')
|
|
->options(['DE' => 'Deutschland', 'AT' => 'Österreich', 'CH' => 'Schweiz', 'NL' => 'Niederlande', 'DK' => 'Dänemark', 'PL' => 'Polen'])
|
|
->default('DE')
|
|
->required(),
|
|
]),
|
|
Section::make('Verwaltung')
|
|
->columnSpan(1)
|
|
->schema([
|
|
TagsInput::make('tags')
|
|
->label('Markierungen')
|
|
->suggestions(['Stammgast', 'Familie', 'Empfehlung', 'Nicht wieder vermieten']),
|
|
TextEntry::make('marketing_consent_at')
|
|
->label('Einwilligung Angebote per E-Mail')
|
|
->state(fn (?Guest $record): string => $record?->marketing_consent_at ? 'bestätigt am '.$record->marketing_consent_at->format('d.m.Y') : 'keine'),
|
|
TextEntry::make('anonymized_at')
|
|
->label('Anonymisiert')
|
|
->dateTime('d.m.Y')
|
|
->visible(fn (?Guest $record): bool => $record?->anonymized_at !== null),
|
|
Textarea::make('notes')->label('Notizen')->rows(5),
|
|
]),
|
|
]);
|
|
}
|
|
}
|