调整使用公共返回方法

This commit is contained in:
古俊杰 2021-12-27 22:51:29 +08:00
parent 61ff24e723
commit 106f65feb1
1 changed files with 1 additions and 1 deletions

View File

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