/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $product = Product::findOrFail($id); $product_types = ProductType::lists('title', 'id'); $color = Material::where('type', 3)->lists('name', 'id'); return view('products.edit', compact('product', 'product_types', 'color')); }