Created
June 23, 2023 00:45
-
-
Save ryanKinoti/27e6ac370356a7ed6653e37273104e03 to your computer and use it in GitHub Desktop.
reset password method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function resetPassword(Request $request) | |
{ | |
$new_password = Hash::make($request->input('new_password')); | |
$user_update = User::all()->where('id', '=', $request->input('user_id'))->first(); | |
$user_update->password = $new_password; | |
$user_update->email_verified_at = Carbon::now(); | |
$user_update->update(); | |
return redirect()->route('/')->withErrors(['msg' => 'Password Reset Successfully.']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment