From 106f65feb164a7174b1c4764df20397e1f3fc273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=A4=E4=BF=8A=E6=9D=B0?= Date: Mon, 27 Dec 2021 22:51:29 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BD=BF=E7=94=A8=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E8=BF=94=E5=9B=9E=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/Exceptions/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/app/Exceptions/Handler.php b/api/app/Exceptions/Handler.php index efc33bc..a18882a 100644 --- a/api/app/Exceptions/Handler.php +++ b/api/app/Exceptions/Handler.php @@ -39,7 +39,7 @@ class Handler extends ExceptionHandler // }); $this->renderable(function (ValidationException $e) { - return send_error($e->errors()[0] ?? $e->getMessage(), ErrorCode('ARGS')); + return send_error($e->errors()[array_key_first($e->errors())][0] ?? $e->getMessage(), ErrorCode('ARGS')); }); } }