예제 #1
0
 public function category($id)
 {
     $categories = $this->category->all();
     $category = $this->category->find($id);
     $products = $this->product->ofCategory($id)->get();
     return view('store.category', compact('categories', 'category', 'products'));
 }
예제 #2
0
 public function category($id)
 {
     $categories = Category::all();
     $category = Category::find($id);
     $products = Product::ofCategory($id)->get();
     return view('store.category', compact('categories', 'category', 'products'));
 }
예제 #3
0
 public function categoryScope($id, Category $cat, Product $prod)
 {
     $categories = $cat->all();
     $category = $cat->find($id);
     $products = $prod->ofCategory($id)->get();
     return view('store.category', compact('categories', 'products', 'category'));
 }
예제 #4
0
 public function productsCategory(Category $category, Product $product, $id)
 {
     $categories = $category->all();
     $category = $category->find($id);
     $prodcutsCateogry = $product->ofCategory($id)->get();
     $tags = $this->tag->all();
     return view('store.productsCategory', compact('categories', 'category', 'prodcutsCateogry', 'tags'));
 }