['nullable', 'integer', 'in:25,50,100,999999'], 'search' => ['nullable', 'string', 'max:255'], 'sort' => ['nullable', 'string'], 'direction' => ['nullable', 'string', 'in:asc,desc'], 'highlight' => ['nullable', 'integer'], ]; } public function validatedWithDefaults(): array { $validated = $this->validated(); return [ 'perPage' => $validated['per_page'] ?? 25, 'search' => $validated['search'] ?? '', 'sort' => $validated['sort'] ?? 'created_at', 'direction' => $validated['direction'] ?? 'desc', ]; } }