/** * Show the form for editing the specified resource. * * @param int $id * @return Response */ public function edit($id) { $supply = Supply::find($id); $spares = Spares::lists('spar', 'id'); $spares_selected = $supply->spares->id; $data = array('supply' => $supply, 'spares' => $spares, 'spares_selected' => $spares_selected); // show the edit form and pass the supply return View::make('supply.edit')->with($data); }
/** * Show the form for creating a new resource. * * @return Response */ public function create() { $spares = Spares::lists('spar', 'id'); return View::make('order.create')->with('spares', $spares); }