Наследование: extends Illuminate\Foundation\Http\FormRequest
Пример #1
0
 /**
  * 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);
 }
Пример #2
0
 /**
  * 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);
 }