public function getProduct($id = null) { $cart = $this->userCart(); $product = Store\Product::with('masterProduct')->findOrFail($id); if (!$product->enabled) { abort(404); } return view('store.product', compact('cart', 'product')); }
public function getProduct($id = null) { $cart = $this->userCart(); $product = Store\Product::with('masterProduct')->findOrFail($id); $requestedNotification = Auth::check() ? $product->notificationRequests()->where('user_id', Auth::user()->user_id)->exists() : false; if (!$product->enabled) { abort(404); } return view('store.product', compact('cart', 'product', 'requestedNotification')); }
public function getProduct($id = null) { $cart = $this->userCart(); $product = Store\Product::with("masterProduct")->findOrFail($id); return view("store.product", compact("cart", "product")); }