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\Livewire\Auth\ResetPassword
helps the user reset the password.
public function resetPassword() {
$this->validate();
$existingUser = User::where('email', $this->email)->first();
if($existingUser && $existingUser->id == $this->urlID) {
$existingUser->update([
'password' => Hash::make($this->password)
]);
$this->showSuccesNotification = true;
$this->showFailureNotification = false;
} else {
$this->showFailureNotification = true;
}
}