title: upload multiple files on laravel
body: <p>I have a problem for many file uploads with the request structure for the file variables in an array. the following is the code snippet. i need a solution for this, thanks</p>
  <pre><code>$cimage = count($request-&gt;variant[$loop]['img']);
  for($loops1 = 0; $loops1 &lt; $cimage; $loops1++) {
      $variantImage      = $request-&gt;file($request-&gt;variant[$loop]['img'][$loops1]);
      $nameVariantImage  = $variant-&gt;id . '-' . date('ymdHis') . ($loops1 + 1) . '.' . $variantImage-&gt;getClientOriginalExtension();
      $uploadVariant     = $imageUpload-&gt;upload($variantImage, $nameVariantImage);
      $variantimages          = New ProductImage;
      $variantimages-&gt;product_id = $product-&gt;id;
      $variantimages-&gt;product_variant_id = $variant-&gt;id;
      $variantimages-&gt;images  = $uploadVariant;
      $variantimages-&gt;save();
      }
  </code></pre>