►Laravel 11 Tutorial (with MongoDB): • Laravel 11 Tutorial (with MongoDB)
This is Part 91 of the Laravel 11 Tutorial in which we are building the e-commerce website with Laravel as the front end and MongoDB as the back end.
In this part, we will work on the forgot password functionality. This feature is for users who have forgotten the password for their registered account.
We are going to create a Forgot Password form in which the user will enter his registered email to get an email to update his password.
1) Update login.blade.php :-
First of all, we will add a "Forgot Password" link under the login form at the login.blade.php file that the user can click to recover his password.
2) Create Route:-
Create Get/POST Route for forgot-password in web.php file like below:-
// Forgot Password
Route::match(['get','post'],'user/forgot-password',[UserController::class,'forgotPassword']);
3) Create forgotPassword function:-
Now create the forgotPassword function at UserController that will return to the forgot_password.blade.php file.
4) Create forgot_password.blade.php :-
Now create the forgot_password.blade.php file under /resources/views/front/users/ folder and create a forgot password form with an email field that the user will fill to rest his password.
We will get its HTML from the lost-password.html file located in the SiteMakers Eshop template.
5) Update custom.js file:-
Add jQuery function for forgot password in custom.js file
6) Update forgotPassword function :-
7) Create reset_password.blade.php
Now create the reset_password.blade.php file under the resources/views/emails folder in which we will send the link to the user to reset his password.
Now, we will reset the user password and send a confirmation email to the user.
8) Create Route :-
Create GET/POST route to reset the user password in web.php file like below:
// Reset Password
Route::match(['get','post'],'user/reset-password/{code?}',[UserController::class,'resetPassword']);
9) Create resetPassword function :-
Now create the resetPassword function at UserController that will return to the reset_password.blade.php file.
10) Create reset_password.blade.php :-
Now create the reset_password.blade.php file under /resources/views/front/users/ folder and create a reset password form with a new password field and code as hidden field.
11) Update custom.js file:-
Add jQuery function for resetting password in custom.js file
12) Update resetPassword function:-
Now update the resetPassword function to reset the current user password with the new one and we will send the new password to user's email as well.
13) Create user_new_password.blade.php
Now create the user_new_password.blade.php file under the resources/views/emails folder in which we will send the user new password.
►Click here to subscribe for Laravel & other updates - / stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel 11 PostgreSQL Tutorial: • Laravel PostgreSQL Tutorial
►Laravel 10 Tutorial: • Laravel 10 Tutorial: Make Admin Panel...
►Laravel Multi-Vendor E-commerce Series - • Laravel Multi Vendor Tutorial
►React JS Tutorial for Beginners with Laravel - • React JS Tutorial with Laravel for Be...
►Laravel Tutorial for Beginners - • Laravel Tutorial for Beginners | Adva...
►GIT Tutorial for Beginners - • Git Tutorial for Beginners | Create y...
►Laravel API Tutorial - • Laravel API Tutorial | Create API fro...
►Laravel Interview Questions - • Laravel Interview Questions & Answers...
►jQuery Tutorial - • jQuery Tutorial
►Laravel Basic E-commerce Series - • Make Admin Panel / E-commerce Website...
►Laravel Dating Series - • Make Dating / Social Networking Websi...
►Join this channel to get the complete source code of all series:
/ @stackdevelopers
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - / stackdevelopers2
►Join Facebook Group to resolve your queries - / stackdevelopers
►Follow on Instagram - / stackdevelopers2
►Follow on GitHub - https://github.com/stackdevelopers
#laravel11 #mongodb #mongodbtutorial
Watch video MongoDB Laravel Tutorial #91 | Forgot Password Code | Send Reset Password Email to Reset Password online without registration, duration hours minute second in high quality. This video was added by user Stack Developers 10 August 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 49 once and liked it 0 people.