In this video we are going to learn about Edit Product Gallery.
So let see how can we Edit the Product Gallery.
For that lets open the AdminEditProdcutComponent Class file
And here create two new property first

public $images;
public $newimages;

Now inside the mount method just write here

$this->images = explode(\",\",$product->images);

Now go to the AdminEditProductComponent view file add the following code.

<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=\"newimages\" multiple />
@foreach($newimages as $newimage)
<img src=\"{{$newimage->temporaryUrl()}}\" width=\"120\" />
@foreach($images as $image)
<img src=\"{{asset('assets/images/products')}}/{{$image}}\" width=\"120\" />

Now go the class file and here inside the updageProduct method and add the following code.

$images = explode(\",\",$product->images);
foreach($images as $image)

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

Now its done so lets check it so switch to browser and refresh the page
And now edit any product and here add the image gallery
Now you can see the image gallery added
Lets check it so go to the shop page
And find this product and here you can see the image gallery
Now lets change this image gallery
So go to the product page and edit this product
Now change the image
And click on update
Now its updated now go the product details page here you cans see the updated product gallery images
So in this way you can edit the product gallery. so that's all about edit product gallery