In Part 107 of the Laravel 9 Tutorial to create a Multi-Vendor E-commerce Website in Laravel 9, we will continue working on the user register/login process.
In this video, we will work on user logout and validate the register form with Validator class via Ajax.
1) Create Logout Route :-
Now we will create a logout route in the web.php file to log out the user.
// Logout User
Route::get('user/logout','UsersController@userLogout');
2) Create logoutUser function :-
Now create userLogout function in Front\UsersController from where we will log out the user and redirect the user to the index or login/register page again.
3) Update header.blade.php file:-
Now we will update the header.blade.php file to show My Account and Logout links when the user is logged in and we will use Auth::check to verify whether the user is logged in.
Now we will validate Register form with Validator Class via Ajax
4) Update login_register.blade.php file :-
We will update the register form and add p tag with id for Ajax response that we will use later on.
5) Update userRegister function :-
Now we will update the userRegister function to validate the user data coming from the register form.
6) Update registerForm jQuery function :-
Now we will update registerForm jQuery function for the ajax response and print the message if validation failed for any of the field.
In the next video, we will work on sending register email to the user.
►Laravel 9 Tutorial (Create Multi-Vendor E-commerce Website) - • Laravel Multi Vendor Tutorial
►Laravel 9 Playlist - • Learning Laravel 9
►Click here to subscribe for Laravel & other updates - / stackdevelopers
Popular Stack Developers Series that can help you:-
►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
#laravel9 #laravel9tutorial #laravel