From b93cd84052f1d5c5277cc8de8b2b45c6ea6c3f96 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 30 Jan 2016 22:20:09 +1100 Subject: [PATCH] Working on products api --- app/Http/Controllers/ProductApiController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);