Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1944091

Browse files
committed
更新数组函数6.x
1 parent 678be5a commit 1944091

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎laravel/app/Exceptions/Handler.php‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Illuminate\Validation\ValidationException;
1212
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
1313
use Tymon\JWTAuth\Exceptions\TokenBlacklistedException;
14+
use Illuminate\Support\Arr;
1415

1516
class 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) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /