Laravel 9 Tutorial #43 | MultiVendor Ecommerce | Products Module (VI) | Add Product Image/Video

Опубликовано: 05 Август 2026
на канале: Stack Developers
1,833
34

In Part-43 of the Laravel 9 Tutorial to create a Multi-Vendor E-commerce Website in Laravel, we will continue working on the Products module. In this video, we will add the product main image after resize into small, medium and large sizes with the help of the Intervention package that we installed earlier at the beginning of the series. And we will also add a product video as well in this video.

1) Create product_images folder:-
First of all, create product_images folder under /public/images/ path and then add small, medium and large folders under product_images folder that will look like below :-
/public/front/images/product_images/small/
/public/front/images/product_images/medium/
/public/front/images/product_images/large/

2) Update addEditProduct function :-
Update the addEditProduct function in ProductsController to write code to add the product main image by resizing it to small, medium and large sizes that we will upload in small, medium and large folders created in the last step.

The intervention package helps us to resize images into 3 parts and add in folders.

We will check the products images size in our E-commerce design that I am going to give you after a few classes.

We will resize the products images sizes like below:-
small: 250 x 250
medium: 500 x 500
large: 1000 x 1000

We need to upload large size of images with width 1000 and height 1000 that will resize to small and medium sizes.

3) Include image class:-
Now include the image class at the top of ProductsController so that we can add/update and resize images with the Intervention package that we have installed in Part-15:-    • Laravel 9 Tutorial #15 | Create Multi Vend...  
use image;

Now you can see in the video, that we are able to add product images into their respective folders after resizing them.

Now we will add product videos.

4) Create product_videos folder:-
Create videos folder under /public/ folder and then create product_videos folder under /public/front/videos/ folder where we will upload all product videos.

5) Update addEditProduct function :-
Update addEditProduct function in ProductsController to write code to add product video.

Now, we can able to add video of the product as well.

Now, we are going to show product images on view products page in admin panel. If product image of the product not added then we will show dummy image of the product. And we will generate dummy image online.

6) Update products.blade.php file :-
Update view products page in admin panel to show product main image if it exists otherwise show dummy product image that we will generate from below website:-
https://dummyimage.com

We will create dummy image of width 100px and height 100px and will add text "No Image" in it.

Now we will add one more condition that if the product image is not there in the products folder then again it will show a dummy image.
In the next video, we will start working on edit functionality for the product.

Thanks for watching :)

►Laravel 9 Tutorial (Create Multi-Vendor E-commerce Website) -    • Laravel Multi Vendor Tutorial  

►Get Ready for Laravel 9 -    • 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 | Advance E...  

►GIT Tutorial for Beginners -    • Git Tutorial for Beginners | Create your F...  

►Laravel API Tutorial -    • Laravel API Tutorial | Create API from Scr...  

►Laravel Interview Questions -    • Laravel Interview Questions & Answers | 20...  

►jQuery Tutorial -    • jQuery Tutorial  

►Laravel Basic E-commerce Series -    • Make Admin Panel / E-commerce Website in L...  

►Laravel Dating Series -    • Make Dating / Social Networking Website in...  

►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