Working on products api
This commit is contained in:
parent
1e8a4c2b70
commit
1f36e175dd
1 changed files with 4 additions and 3 deletions
|
|
@ -29,11 +29,12 @@ class ProductApiController extends BaseAPIController
|
|||
|
||||
public function index()
|
||||
{
|
||||
$products = Product::scope()->withTrashed();
|
||||
$products = $products->orderBy('created_at', 'desc')->paginate();
|
||||
//$products = Product::scope()->withTrashed()->orderBy('created_at', 'desc')->paginate();
|
||||
//$products = $products
|
||||
|
||||
$products = Product::scope()->withTrashed()->paginate();
|
||||
$transformer = new ProductTransformer(\Auth::user()->account, $this->serializer);
|
||||
$data = $this->includeCollection($products, $transformer, 'products', $products->paginate());
|
||||
$data = $this->includeCollection($products, $transformer, 'products');
|
||||
|
||||
return $this->response($data);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue