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')); }); } }