public function update() { if (Input::has('user_id') && Input::has('email') && Input::has('name') && Input::has('phone') && Input::has('city_id') && Input::has('address')) { $user = UserModel::find(Input::get('user_id')); $user->email = Input::get('email'); $user->name = Input::get('name'); $user->phone = Input::get('phone'); $user->city_id = Input::get('city_id'); $user->address = Input::get('address'); if (Input::get('password') != '') { $user->secure_key = md5($user->salt . Input::get('password')); } $user->save(); return Response::json(['result' => 'success', 'msg' => '']); } else { return Response::json(['result' => 'failed', 'msg' => 'Invalid Request']); } }