In this video we are going to learn about Add Product Gallery Image.
So let see how can we add multiple images as product gallery for a product.
So switch to the project
And lets open the AdminAddProductComponent view file
Inside this file after the product image lets add the following code for the product gallery

<div class=\"form-group\">
<label class=\"col-md-4 control-label\">Product Gallery</label>
<div class=\"col-md-4\">
<input type=\"file\" class=\"input-file\" wire:model=\"images\" multiple />
@if($images)
@foreach($images as $image)
<img src=\"{{$image->temporaryUrl()}}\" width=\"120\" />
@endforeach
@endif
@error('images') <p class=\"text-danger\">{{$message}}</p> @enderror
</div>
</div>

Now go to the AdminAddProductComponent class file
And here lets add a properties for image gallery
So here just write

public $images;

Now inside the addProduct method add the following code

if($this->images)
{
$imagesname = '';
foreach($this->images as $key=>$image)
{
$imgName = Carbon::now()->timestamp. $key. '.' . $image->extension();
$image->storeAs('products',$imgName);
$imagesname = $imagesname . ',' . $imgName;
}
$product->images = $imagesname;
}


Now lets display these gallery images on product details page
So go to the product details page and lets find the div which class is product-gallery and add the following code

<div class=\"detail-media\">
<div class=\"product-gallery\" wire:ignore>
<ul class=\"slides\">
<li data-thumb=\"{{ asset('assets/images/products' ) }}/{{$product->image}}\">
<img src=\"{{ asset('assets/images/products') }}/{{$product->image}}\" alt=\"{{$product->name}}\" />
</li>
@php
$images = explode(\",\",$product->images);
@endphp
@foreach($images as $image)
@if($image)
<li data-thumb=\"{{ asset('assets/images/products' ) }}/{{$image}}\">
<img src=\"{{ asset('assets/images/products') }}/{{$image}}\" alt=\"{{$product->name}}\" />
</li>
@endif
@endforeach
</ul>
</div>
</div>


Now all done lets check so switch to browser and refresh the page.
Now create new product and product image and product gallery images.
after the adding product check the product details page.
and you will get the product with image gallery.
So in this way you can add product image gallery.