filmov
tv
MongoDB Laravel Tutorial #89 | Login/Register (VI) | Login User Functionality Validate Form
Показать описание
This is Part 89 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. We will continue working on the Laravel Login and Register process with default Laravel Web Authentication.
In this part, we will work on login functionality and add validations there.
First, we will update the login form with the form ID and csrf token along with the id and name for the email and password fields. We will not add any URL in action as we will call the jQuery function with the form ID.
2) Create loginForm jQuery function:-
3) Create Route:-
// User Login
Route::post('user/login',[UserController::class,'loginUser']);
4) Update loginUser function:-
Now we will update the loginUser function with all required validations to log the user into the website.
5) Update loginForm jQuery function:-
Update the loginForm jQuery function once again to update the response in Ajax and send the user to the cart page if he can successfully log in.
Popular Stack Developers Series that can help you:-
►Join this channel to get the complete source code of all series:
Follow Stack Developers on Social Media to get updates and resolve your queries
#laravel11 #mongodb #mongodbtutorial