Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mehrdad70's avatar

upload multiple image for product in laravel 7

I tried very hard to find a solution to upload the multiple image but I did not succeed How do I do this? I have three tables

Media

product

media_product => image_id product_id

    public function products()
{
    return $this->belongsToMany(Product::class);    
}

    public function images()
{
    return $this->belongsToMany(Media::class);    
}


<div class="control-group form-group mb-0">
  <label class="form-label">image </label>
 <input type="file" name="images[]"  class="form-control required" placeholder="product images" multiple>
0 likes
3 replies
mehrdad70's avatar

Thnaks for you. but I have a problem with uploading array images.

Please or to participate in this conversation.