/** * @param Request $request * @return \Illuminate\Http\RedirectResponse */ public function addpost(Request $request) { $product = product::with('images')->find($request->input('id')); Cart::add($product->id, $product->name, $request->input('amount'), $product->price, ['size' => $request->input('size'), 'image' => $product->images[0]->image]); Session::flash('success', "Het product is toegevoegd aan de winkelwagen"); return redirect()->back(); }
public function index() { $products = product::with('images', 'sizes')->get(); return view('cms.products.products', compact('products')); }