public function postEdit() { $admin = Admin::find(\Auth::user()->id); $inputs = \Input::all(); $admin->update($inputs); $admin->save(); return \View('panelViews::editProfile')->with(array('admin' => $admin, 'message' => \Lang::get('panel::fields.successfullEditProfile'))); }
public function postEdit() { $demo = false; if (\Config::get('panel.demo') == true) { $demo = true; } $admin = Admin::find(\Auth::user()->id); $inputs = \Input::all(); $admin->update($inputs); $admin->save(); return \View('panelViews::editProfile')->with(array('admin' => $admin, 'message' => \Lang::get('panel::fields.successfullEditProfile'), 'demo_status' => $demo)); }
public function postChangePassword() { $user = Admin::find(\Auth::guard('panel')->user()->id); $password = Input::only('current_password'); $new_password = Input::only('password'); $retype_password = Input::only('password_confirmation'); $user_password = \Auth::guard('panel')->user()->password; //Check to see if user enters current password correctly if (\Hash::check($password['current_password'], $user_password)) { if ($new_password['password'] == $retype_password['password_confirmation']) { $user->password = \Hash::make($new_password['password']); $user->save(); return \Redirect::to('/panel/changePassword')->with('message', 'Successfully Changed Your Password!!'); } else { return \Redirect::to('/panel/changePassword')->with('message', 'Passwords not matched!!')->with('mesType', 'error'); } } else { return \Redirect::to('/panel/changePassword')->with('message', 'Password is not correct!!')->with('mesType', 'error'); } }