コード例 #1
0
 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())]);
 }
コード例 #2
0
 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());
 }
コード例 #3
0
 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));
 }