'required|exists:sants,id' ]; } protected function failedValidation(Validator $validator) { if (Request::wantsJson()) { throw new HttpResponseException(response()->json(['message' => $validator->errors()->first(), 'error' => true, 'status' => 422], 422)); } else { throw new ValidationException($validator); } } }