Exemplo n.º 1
0
 /**
  *
  *
  * @param $id The Product ID
  * @param Product $prod
  * @return \Illuminate\Http\RedirectResponse
  */
 public function add($id, Product $prod)
 {
     $cart = $this->getCart();
     $product = $prod->find($id);
     $cart->add($id, $product->name, $product->price);
     Session::set('cart', $cart);
     return redirect()->route('cart');
 }
Exemplo n.º 2
0
 public function product(Category $cat, Product $prod, $id)
 {
     $categories = $cat->all();
     $product = $prod->find($id);
     return view('store.product', compact('categories', 'product'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $products = $this->products->all();
     return view('admin-products', compact('products'));
 }