/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { if (!$id) { return Redirect::route('products.index')->with('error', 'Please Provide product id'); } $product = Products::find($id); if (empty($product)) { return Redirect::route('products.index')->with('error', 'Product not found'); } $types = Types::dropdownList(); $units = Units::dropdownList(); return View::make('products.edit', compact('product', 'types', 'units')); }