/** * 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')); }
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')); }