DEV Community

Cover image for Laravel 9 Forgot Password Email
shani singh
shani singh

Posted on

Laravel 9 Forgot Password Email

Send Forgot Password EMAIL to reset password.

We have already covered Laravel installation and Laravel Auth Scaffolding.

Next We will cover forgot password flow using Laravel/UI.

Step 1

Gather SMTP Details, you can use any SMTP but for this tutorial i am going to use MailTrap, this is a email testing tool you can use while developing any SMTP feature.

The Detail we require are

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=#############
MAIL_PASSWORD=############
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="test@test.com"
MAIL_FROM_NAME="${APP_NAME}"
Enter fullscreen mode Exit fullscreen mode

We have to update these details in .env file.

Step 2

Now go to password reset route /password/reset you will see the reset password page.

Reset Password

Now enter the registered email address and click on Send Password Link.

Email Link Sent

You should get an email in MAILTRAP Inbox.

Reset Email Look Like

Once you click on Reset Password Button from Email you will land to Change password screen.

Reset Password Page

After you enter new password you will redirect to homepage.

Reset Password Success

The Complete Video Tutorial is below in the video.

If you face any issue while implementing, please comment your query.

Thank You for Reading

Reach Out To me.
Twitter
Instagram
YouTube

Top comments (2)

Collapse
 
chxrain profile image
M

How do you change the email template with the Laravel Logo into your site's own logo and color schemes? Thanks

Collapse
 
shanisingh03 profile image
shani singh

Hey You can export the laravel email by running command,
php artisan vendor:publish --tag=laravel-mail
This command will publish the Markdown mail components to the resources/views/vendor/mail directory.
you can edit those components there.
Hope this will help.
Thanks