/** * 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); }
/** * {@inheritDoc} */ public function response(array $errors) { if (is_api_request()) { return app('api.response')->unprocessableError($errors); } return parent::response($errors); }
/** * 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); }
/** * @param array $errors * * @return mixed */ public function response(array $errors) { return parent::response($errors)->with('notice-error', trans('tinyissue.we_have_some_errors')); }