需要对分页数据进行transformer,但是不知道如何解决,下面是我的代码
$devis=DB::table('devis')->orderBy('category_id','DESC')->paginate(10);
return $this->respondWithCollection($devis,new DevisTransformer());
返回500
错误信息:"Type error: Argument 1 passed to AppHttpControllersApiController::respondWithCollection() must be an instance of IlluminateSupportCollection, instance of IlluminatePaginationLengthAwarePaginator given,
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
用
$this->response->paginator()