/** * Store a newly created allergy in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), array('allergy_name' => 'required')); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } Allergy::create($data); return Redirect::to('allergies?id=' . $data['patient_id']); }