/** * Update the specified allergy in storage. * * @param int $id * @return Response */ public function update($id) { $allergy = Allergy::findOrFail($id); $validator = Validator::make($data = Input::all(), array('allergy_name' => 'required')); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $data['patient_id'] = $allergy->patient_id; $allergy->update($data); return Redirect::to('allergies?id=' . $allergy->patient_id); }