public function showProductByCategory($id) { $category = new Category(); $products = $category->products($id); $image = new Image(); $tag = new Tag(); view('front.category', compact('products', 'image', 'tag')); }
public function showCategory($id) { $category = new Category(); $products = $category->products($id); $categories = $category->all(); $image = new Image(); $tag = new Tag(); view('front.index', compact('products', 'image', 'tag', 'categories')); }