In Part-58 of the Laravel 9 Tutorial to create a Multi-Vendor E-commerce Website in Laravel, we will continue working on making home page banners dynamic for our e-commerce website. In this video, we will work on making advertisement banners dynamic on the home page.
1) Update banners table (with Migration) :-
First of all, we will add the below column in the banners table with migration:-
type
Run the below command to create the migration file to update the banners table with required columns:-
php artisan make:migration update_banners_table
Make changes in the update_banners_table migration file as shown in the video and run the below command:-
php artisan migrate
Now you can check; type column added in the banners table.
2) Update add_edit_banner.blade.php file :-
Add select drop down for Banner Type at add_edit_banner.blade.php file that can be either Slider or Fix banner.
3) Update BannersController :-
Now update BannersController to insert the type of banner as well and also we can add laravel validation to make it mandatory.
We can also add condition to resize fix size banners like below :-
Width: 1920
Height: 450
4) Update index function :-
Now update index function at IndexController to fetch sliderBanners and fixBanners according to banner type and return to index blade file.
5) Update index.blade.php :-
Now update home page with slider and fix banners in foreach loop
►Laravel 9 Tutorial (Create Multi-Vendor E-commerce Website) - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYTlQ97V1Tl8mirS3qXHNFZ
►Get Ready for Laravel 9 - https://www.youtube.com/playlist?list=PLLUtELdNs2ZYVb9lco6OnloSFyBLZU3tz
►Click here to subscribe for Laravel & other updates - https://www.youtube.com/stackdevelopers
Popular Stack Developers Series that can help you:-
►Laravel Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZaHaFmydqjcQ-YyeQ19Cd6u
►GIT Tutorial for Beginners - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZVQ-dLOMFWvmCCduzJ8c6R
►Laravel API Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbcCsd4yAAiBU2L3ROREk8P
►Laravel Interview Questions - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbzB_1Jdp_yFcORwOfWP8RU
►jQuery Tutorial - https://www.youtube.com/playlist?list=PLLUtELdNs2ZbMYoUA46GIonOH29KcjtxA
►Laravel Basic E-commerce Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZY5drPxIWzpq5crhantlzp7
►Laravel Dating Series - https://www.youtube.com/playlist?list=PLLUtELdNs2ZZrPUnxjlomErJfNvkyS6Hf
►Join this channel to get the complete source code of all series:
https://www.youtube.com/channel/UCExO2i-tLU1NyVZD6zOJQlw/join
Follow Stack Developers on Social Media to get updates and resolve your queries
►Like Facebook Page to get updates - http://facebook.com/stackdevelopers2/
►Join Facebook Group to resolve your queries - http://facebook.com/groups/stackdevelopers
►Follow on Instagram - https://www.instagram.com/stackdevelopers2/
►Follow on GitHub - https://github.com/stackdevelopers
#laravel9 #laravel9tutorial #laravel