Example #1
0
 /**
  * Display a listing of products
  *
  * @return Response
  */
 public function index()
 {
     if ($this->category) {
         $query = $this->category->products();
     } else {
         $query = Product::query();
     }
     $models = $query->paginate(15);
     return View::make('product::admin.product.index', compact('models'));
 }
Example #2
0
 public function index()
 {
     if ($this->category) {
         $query = $this->category->deepProducts();
     } else {
         $query = Product::query();
     }
     $products = $query->with('images')->paginate(9);
     return View::make('product::product.index', compact('products'));
 }