'Eigener Text', 'legal.imprint' => 'Impressum (Texte › Rechtliches)', 'legal.privacy' => 'Datenschutzerklärung (Texte › Rechtliches)', 'stay.house_rules' => 'Hausregeln (Texte › Aufenthalt)', 'stay.cancellation' => 'Stornobedingungen (Texte › Aufenthalt)', ]; public static function key(): string { return 'rich_text'; } public static function label(): string { return 'Fließtext'; } public static function icon(): string { return 'heroicon-o-bars-3-bottom-left'; } public static function schema(): array { return [ TextInput::make('heading')->label('Überschrift')->maxLength(160), Select::make('source')->label('Inhalt')->options(self::SOURCES)->default('own')->live(), RichEditor::make('text') ->label('Text') ->visible(fn (Get $get): bool => ($get('source') ?? 'own') === 'own') ->toolbarButtons([['bold', 'italic', 'link'], ['h2', 'h3'], ['bulletList', 'orderedList']]), ]; } public function data(Theme $theme, array $data): array { $source = $data['source'] ?? 'own'; return [ 'heading' => $data['heading'] ?? null, 'text' => $source === 'own' || ! array_key_exists($source, self::SOURCES) ? $this->html($data['text'] ?? null) : (filled(Content::get($source)) ? Content::html($source) : null), ]; } }