Files
Lars StommerandClaude Opus 5.5 2892e6aeab Gästeverzeichnis und Customer Voice
- 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>
2026-10-22 10:26:11 +02:00

39 lines
1.4 KiB
PHP

<?php
namespace App\Filament\Resources\Guests\Pages;
use App\Enums\UserRole;
use App\Filament\Resources\Guests\GuestResource;
use App\Models\Guest;
use Filament\Actions\Action;
use Filament\Notifications\Notification;
use Filament\Resources\Pages\EditRecord;
use Filament\Support\Icons\Heroicon;
/**
* @property Guest $record
*/
class EditGuest extends EditRecord
{
protected static string $resource = GuestResource::class;
protected function getHeaderActions(): array
{
return [
Action::make('anonymize')
->label('Anonymisieren')
->icon(Heroicon::OutlinedEyeSlash)
->color('danger')
->visible(fn (): bool => $this->record->anonymized_at === null && (bool) auth()->user()?->hasRole(UserRole::Admin))
->requiresConfirmation()
->modalDescription('Name, Kontaktdaten, Notizen und Nachrichten werden unwiderruflich entfernt (z. B. auf Löschwunsch nach DSGVO). Buchungen und Beträge bleiben für die Buchhaltung erhalten.')
->action(function (): void {
$this->record->anonymize();
$this->refreshFormData(['first_name', 'last_name', 'email', 'phone', 'street', 'postal_code', 'city', 'notes', 'tags']);
Notification::make()->title('Gast anonymisiert')->success()->send();
}),
];
}
}