Reset Password

An email is sent to the user's address to help him reset his password.


The user can access the reset password page by clicking the button found in the email. The link for resetting the password is available for 12 hours and is unique for the user. The user must add the email, the password and confirm the password for his password to be updated.

The App\Http\Controllers\Auth\ChangePassword.php helps the user reset the password.

                          
$existingUser = User::where('email', $attributes['email'])->first();
if ($existingUser) {
    $existingUser->update([
        'password' => $attributes['password']
    ]);
    return redirect('login');
} else {
    return back()->with('error', 'Your email does not match the email who requested the password change');
}