laravel transformer for paginated data
PHP中文网
PHP中文网 2017-05-16 16:50:46
0
1
483

Need to transform the paging data, but I don’t know how to solve it. Here is my code

$devis=DB::table('devis')->orderBy('category_id','DESC')->paginate(10);
        return $this->respondWithCollection($devis,new DevisTransformer());

Return 500
Error message:"Type error: Argument 1 passed to AppHttpControllersApiController::respondWithCollection() must be an instance of IlluminateSupportCollection, instance of IlluminatePaginationLengthAwarePaginator given,

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
大家讲道理

Use $this->response->paginator()

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template