@@ -743,18 +743,18 @@ |
||
743 | 743 | $errors = [$e->getMessage()]; |
744 | 744 | } |
745 | 745 | |
746 | - if (in_array($request->getMethod(), ['OPTIONS', 'HEAD'], true)) { |
|
747 | - throw $e; |
|
748 | - } |
|
749 | - |
|
750 | - if ($this->request->isJson() || $this->request->expectsJson()) { |
|
751 | - return $this->formatResponse($response->withStatus($code), [ |
|
752 | - 'success' => false, |
|
753 | - 'code' => $code, |
|
754 | - 'errors' => $errors, |
|
755 | - ]); |
|
756 | - } |
|
757 | - |
|
758 | - return Services::redirection()->back()->withInput()->withErrors($errors)->withStatus($code); |
|
746 | + if (in_array($request->getMethod(), ['OPTIONS', 'HEAD'], true)) { |
|
747 | + throw $e; |
|
748 | + } |
|
749 | + |
|
750 | + if ($this->request->isJson() || $this->request->expectsJson()) { |
|
751 | + return $this->formatResponse($response->withStatus($code), [ |
|
752 | + 'success' => false, |
|
753 | + 'code' => $code, |
|
754 | + 'errors' => $errors, |
|
755 | + ]); |
|
756 | + } |
|
757 | + |
|
758 | + return Services::redirection()->back()->withInput()->withErrors($errors)->withStatus($code); |
|
759 | 759 | } |
760 | 760 | } |