public function index() { $products = $this->product->eagerLoadPaginated(10); if (!$products) { return $this->respondNotFound('No Product Found'); } return $this->respondWithPagination($products, ['data' => $this->productTransformer->transformCollection($products->toArray())]); }
public function index() { // $product = Cache::get('productAdmin'); //dd($product); //if ($product != null) { // return view('backend.product.index')->withProducts($product); //} $product = $this->product->eagerLoadPaginated(10); //Cache::tags('productAdmin')->put('productAdmin',$product , 43200); return view('backend.Product.index')->withProducts($product); // return view('backend.product.index') // ->withProducts($this->product->getAllProducts()); }
public function show($id) { //dd($this->product->eagerLoadWhere('',$id)); return Theme::view('frontend.product.show')->withProduct($this->product->eagerLoadWhere('', $id))->withProducts($this->product->eagerLoadPaginated(10)); }