コード例 #1
0
ファイル: Request.php プロジェクト: BePsvPT/CCU-Plus
 /**
  * Get the proper failed validation response for the request.
  *
  * @param  array  $errors
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function response(array $errors)
 {
     if ($this->ajax() || $this->wantsJson()) {
         return response()->json(['messages' => $errors], 422);
     }
     return parent::response($errors);
 }
コード例 #2
0
ファイル: Request.php プロジェクト: valdinei/rest
 /**
  * {@inheritDoc}
  */
 public function response(array $errors)
 {
     if (is_api_request()) {
         return app('api.response')->unprocessableError($errors);
     }
     return parent::response($errors);
 }
コード例 #3
0
ファイル: FormRequest.php プロジェクト: arcanedev/support
 /**
  * Get the proper failed validation response for the request.
  *
  * @param  array  $errors
  *
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function response(array $errors)
 {
     return $this->ajaxRequest ? $this->formatJsonErrorsResponse($errors) : parent::response($errors);
 }
コード例 #4
0
ファイル: Request.php プロジェクト: oliverpool/tinyissue
 /**
  * @param array $errors
  *
  * @return mixed
  */
 public function response(array $errors)
 {
     return parent::response($errors)->with('notice-error', trans('tinyissue.we_have_some_errors'));
 }