File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 1111use Illuminate \Validation \ValidationException ;
1212use Symfony \Component \HttpKernel \Exception \UnauthorizedHttpException ;
1313use Tymon \JWTAuth \Exceptions \TokenBlacklistedException ;
14+ use Illuminate \Support \Arr ;
1415
1516class Handler extends ExceptionHandler
1617{
@@ -59,7 +60,7 @@ public function render($request, Exception $exception)
5960 if ($ exception instanceof ValidationException) {
6061 // $code = 1104;
6162 // return response(['error' => array_first(array_collapse($exception->errors()))], 400);
62- return $ this ->getResultByCode (1104 , array_first ( array_collapse ($ exception ->errors ())));
63+ return $ this ->getResultByCode (1104 , Arr:: first (Arr:: collapse ($ exception ->errors ())));
6364 }
6465 // 用户认证的异常,我们需要返回 401 的 http code 和错误信息
6566 if ($ exception instanceof UnauthorizedHttpException) {
You can’t perform that action at this time.
0 commit comments