reportable(function (Throwable $e) { // }); } public function render($request, Throwable $exception) { if ($exception instanceof ValidationException) { return response()->json([ 'code' => 422, 'msg' => '调用参数错误', 'data' => $exception->errors()->first(), ], 422); } return parent::render($request, $exception); } }