Skip to content

Instantly share code, notes, and snippets.

@ryanKinoti
Created June 23, 2023 00:45
Show Gist options
  • Save ryanKinoti/27e6ac370356a7ed6653e37273104e03 to your computer and use it in GitHub Desktop.
Save ryanKinoti/27e6ac370356a7ed6653e37273104e03 to your computer and use it in GitHub Desktop.
reset password method
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