►Laravel 9 Tutorial from the beginning:- • Laravel Multi Vendor Tutorial
In Part-187 of the Multi Vendor E-commerce series, we will continue working on the Newsletter Subscriber feature in which users can subscribe to the website newsletter by entering their emails.
In this video, we will work on newsletter subscriber functionality. We will create a newsletter subscriber field and will insert the subscriber email in the newsletter_subscribers table if not already exists.
1) Update footer.blade.php file:-
First of all, add the Newsletter Subscriber email field at footer.blade.php file in which the user can enter his email to subscribe for newsletters along with Subscribe button.
We will also add addSubscriber onclick function at Subscribe button by which we will call Ajax to insert the subscriber email.
2) Update custom.js file :-
Now we will update custom.js file to create addSubscriber function in which we will call Ajax to return subscriber email.
3) Create Route:-
Now we will create Post Route to insert subscriber email in web.php file like below :-
// Add Subscriber Email
Route::post('/add-subscriber-email','NewsletterController@addSubscriber');
4) Create NewsletterController :-
Now create NewsletterController for Front website by running below artisan command:-
php artisan make:controller Front/NewsletterController
5) Create addSubscriber function :-
In the final step, we will create addSubscriber function in which we will get subscriber email from Ajax and insert it into the newsletter_subsribers table and if email already exists then we will alert the error message via Ajax response.
►Laravel 9 Tutorial Playlist (Create Multi-Vendor E-commerce Website) - • Laravel Multi Vendor Tutorial
►Click here to subscribe for Laravel & other updates - / stackdevelopers
Popular Stack Developers Series that can help you:-
►React JS Tutorial for Beginners with Laravel 9 - • 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
#laravel9 #laravel9tutorial #laravel