Learn about the password reset link logic implemented in the Larafast API Boilerplate.
PasswordResetLinkController
class.
PasswordResetLinkRequest
class, which extends Laravel’s FormRequest
class. Currently, there are no validation rules specified in this class.
store
method in the PasswordResetLinkController
class handles the generation of the password reset link. It uses Laravel’s Password
facade to send a password reset link to the email address provided in the request.
If the password reset link cannot be sent, a ValidationException
is thrown with a message indicating the reason.
routes/auth.php
file. The route uses the PasswordResetLinkController
class and the store
method.
NewPasswordController
class.
NewPasswordRequest
class, which extends Laravel’s FormRequest
class. The rules
method of this class specifies that the token
, email
, and password
fields are required.
store
method in the NewPasswordController
class handles the password reset. It uses Laravel’s Password
facade to reset the user’s password. If the password reset is successful, the user’s password is updated in the database and a PasswordReset
event is dispatched.
If the password reset is not successful, a ValidationException
is thrown with a message indicating the reason.
routes/auth.php
file. The route uses the NewPasswordController
class and the store
method.