label('Überschrift')->maxLength(120), Select::make('category')->label('Bilder')->options(['all' => 'Alle', ...collect(PhotoCategory::cases())->mapWithKeys(fn (PhotoCategory $category): array => [$category->value => $category->getLabel()])->all()])->default('all'), TextInput::make('limit')->label('Anzahl (leer = alle)')->integer()->minValue(1), ]; } public static function photoSlots(): array { return ['photo_ids' => ['label' => 'Galerie', 'type' => self::SLOT_COLLECTION]]; } public function data(Theme $theme, array $data): array { $category = PhotoCategory::tryFrom($data['category'] ?? ''); return [ 'heading' => $data['heading'] ?? null, 'photos' => $this->withSeasonalPhotos($theme, $data, 'photo_ids', Photo::query()->published()->forProperty($theme->property())->with('media') ->when($category, fn ($query) => $query->where('category', $category)) ->when(filled($data['limit'] ?? null), fn ($query) => $query->limit((int) $data['limit'])) ->get()), ]; } }