diff --git a/app/Http/Controllers/ProductApiController.php b/app/Http/Controllers/ProductApiController.php index 77ed746ee0..d6aa7b2330 100644 --- a/app/Http/Controllers/ProductApiController.php +++ b/app/Http/Controllers/ProductApiController.php @@ -33,8 +33,10 @@ class ProductApiController extends BaseAPIController //$products = $products $products = Product::scope()->withTrashed(); + $paginator = Product::scope()->withTrashed()->paginate(); + $transformer = new ProductTransformer(\Auth::user()->account, $this->serializer); - $data = $this->createCollection($products, $transformer, 'products', $products->paginate()); + $data = $this->createCollection($products, $transformer, 'products', $paginator); return $this->response($data);