> */ public function rules(): array { $editions = [...array_values(TipitakaPageNumberService::EDITIONS), TipitakaPageNumberService::CS]; return [ 'edition' => ['sometimes', 'string', 'in:'.implode(',', $editions)], 'volume' => ['sometimes', 'integer', 'min:1', 'max:99'], ]; } /** * @return array{edition?: string, volume?: int} */ public function filters(): array { $filters = []; if ($this->has('edition')) { $filters['edition'] = (string) $this->validated('edition'); } if ($this->has('volume')) { $filters['volume'] = (int) $this->validated('volume'); } return $filters; } }