|string> */ public function rules(): array { return [ 'partner_id' => 'sometimes|string', 'title' => 'sometimes|string', 'slug' => [ 'sometimes', 'string', Rule::unique('hunts', 'slug')->ignore($this->route('hunt')), ], 'description' => 'nullable|string', 'status' => 'sometimes|string', 'difficulty' => 'sometimes|string', 'city' => 'sometimes|string', 'latitude' => 'nullable|numeric', 'longitude' => 'nullable|numeric', 'start_radius_m' => 'nullable|integer|min:1', 'is_public' => 'boolean', 'estimated_duration_min' => 'nullable|integer', 'start_at' => 'nullable|date', 'end_at' => 'nullable|date', 'image' => 'nullable|string', 'creator_id' => 'nullable|exists:users,id', ]; } /** * Handle a failed validation attempt. * * @return void * * @throws \Illuminate\Http\Exceptions\HttpResponseException */ protected function failedValidation(Validator $validator) { throw new HttpResponseException(response()->json([ 'message' => 'Validation errors', 'errors' => $validator->errors(), ], 422)); } }