In Part-100 of Advance E-com Series in Laravel 6/7/8, we will continue working on user register/login process. In this video, we will work on login functionality and will add validations there as well.
1) Update login_register.blade.php file :-
First of all, update login form with id as loginForm and action url as /login and also add email, password id's.
2) Create loginUser function :-
Now create loginUser function at UsersController in which we will get posted data i.e. email and password. We will check with Auth::attempt and will redirect back with error message in case email or password is incorrect.
3) Update front_script.js :-
Add jQuery validation for email and password fields of login form at front_script.js file.
4) Update login_register.blade.php file :-
Now add error message alert div at login_register.blade.php file to show error message in case email or password is incorrect.
Join this channel to get complete code and access to future videos:
/ @stackdevelopers