/** * Handle a failed validation attempt. * * @param \Illuminate\Contracts\Validation\Validator $validator * * @return mixed */ protected function failedValidation(Validator $validator) { if ($this->container['request'] instanceof BaseRequest) { throw new ApiValidationException($validator->errors(), $this->getFailedValidationMessage($this->container['request'])); } parent::failedValidation($validator); }
/** * failedValidation. * * @author Pedro Coutinho <*****@*****.**> * * @param \Illuminate\Contracts\Validation\Validator $validator * * @return void * @throws \Nodes\Validation\Exceptions\ValidationException */ protected function failedValidation(Validator $validator) { if ($this->container['request'] instanceof Request) { throw new ValidationException($validator, $this->getErrorCodes()); } parent::failedValidation($validator); }