public function save_footer() { $input = Input::all(); $rules = array('footer_preset' => 'required'); $validator = Validator::make(Input::all(), $rules); if ($validator->passes()) { $lastObj = Footer::saveFooter($input); Session::flash('success', 'Save Successfully'); return Response::json(array('success' => TRUE, 'id' => $lastObj, 'label' => $input['footer_preset']), 200); } else { return Redirect::to('objective')->withErrors($validator)->withInput(); } }