authService->check(); } #[\Override] protected function prepareForValidation(): void { if ($this->has('pickup-exception')) { $filterValue = $this->string('pickup-exception'); if ($filterValue->isEmpty()) { $this->session()->forget(self::SESSION_KEY); } else { $this->session()->put(self::SESSION_KEY, (string) $filterValue); } } } public function toPickupExceptionId(): ?PickupExceptionId { $raw = $this->session()->get(self::SESSION_KEY); if ($raw === null || ! is_string($raw) || $raw === '' || ! UuidHelper::isValid($raw)) { return null; } $uuid = UuidHelper::fromString($raw); if (! UuidHelper::isV7($uuid)) { return null; } return new PickupExceptionId($uuid); } public function getPickupExceptionId(): ?PickupExceptionId { return $this->toPickupExceptionId(); } /** @return array */ public function rules(): array { return [ 'pickup-exception' => ['sometimes', 'nullable', 'string', 'uuid'], ]; } }