label('Kleine Überschrift')->maxLength(100), TextInput::make('heading')->label('Überschrift')->default('Derselbe Blick, zwei Jahreszeiten')->maxLength(160), Textarea::make('text')->label('Text')->rows(2)->maxLength(400), static::photoSelect('first_photo_id', 'Erstes Foto (links)') ->helperText('Am besten vom selben Standpunkt aufgenommen wie das zweite Foto. Beide erscheinen in jedem Erscheinungsbild.') ->required(), TextInput::make('first_label')->label('Bezeichnung erstes Foto')->default('Sommer')->required()->maxLength(30), static::photoSelect('second_photo_id', 'Zweites Foto (rechts)')->required(), TextInput::make('second_label')->label('Bezeichnung zweites Foto')->default('Winter')->required()->maxLength(30), ]; } public function data(Theme $theme, array $data): array { $photos = $this->photos(array_values(array_filter([$data['first_photo_id'] ?? null, $data['second_photo_id'] ?? null])))->keyBy('id'); return [ 'eyebrow' => $data['eyebrow'] ?? null, 'heading' => $data['heading'] ?? null, 'text' => $data['text'] ?? null, 'first' => $photos->get((int) ($data['first_photo_id'] ?? 0)), 'second' => $photos->get((int) ($data['second_photo_id'] ?? 0)), 'firstLabel' => filled($data['first_label'] ?? null) ? $data['first_label'] : 'Sommer', 'secondLabel' => filled($data['second_label'] ?? null) ? $data['second_label'] : 'Winter', ]; } }