label('Überschrift')->maxLength(120), ...static::photoSourceFields('Automatisch nach Kategorie'), Select::make('category')->label('Kategorie')->visible(fn (Get $get): bool => $get('photo_source') !== 'selection')->options(['all' => 'Alle', ...collect(PhotoCategory::forGalleries())->mapWithKeys(fn (PhotoCategory $category): array => [$category->value => $category->getLabel()])->all()])->default('all'), TextInput::make('limit')->label('Anzahl (leer = alle)')->integer()->minValue(1), ]; } public function data(Theme $theme, array $data): array { $category = PhotoCategory::tryFrom($data['category'] ?? ''); return [ 'heading' => $data['heading'] ?? null, 'photos' => $this->sourcedPhotos($theme, $data, $category, filled($data['limit'] ?? null) ? (int) $data['limit'] : null), ]; } }