Exemplo n.º 1
0
 public function add($id)
 {
     $cart = $this->getCart();
     $product = Product::find($id);
     $cart->add($id, $product->name, $product->price);
     Session::set('cart', $cart);
     return redirect()->route('cart');
 }
 public function product($id)
 {
     $product = Product::find($id);
     $categories = Category::all();
     return view('store.product', compact('categories', 'product'));
 }