> */ public function rules(): array { return [ 'incoIdLike' => ['required', 'string'], 'brands' => ['sometimes', 'array'], 'brands.*' => ['sometimes', 'string'], 'short' => ['sometimes', Rule::in(['true', 'false', true, false, '1', '0', 1, 0])], ]; } public function authorize(): bool { return true; } public function incoIdSearch(): IncoIdQuery { return new IncoIdQuery($this->string('incoIdLike')->value()); } /** @return array */ public function brands(): array { $raw = $this->array('brands'); $result = []; foreach ($raw as $b) { if (is_string($b) || is_numeric($b)) { $val = trim((string) $b); if ($val !== '') { $result[] = $val; } } } return $result; } public function isShort(): bool { return filter_var($this->input('short', false), FILTER_VALIDATE_BOOLEAN); } }