title: Multiple file upload validation in laravel
body: <p>I have multiple input fields with multiple file upload for each field. </p>
  
  <pre><code>&lt;?php for ($i = 0; $i &lt; $total; $i++)
     {
  ?&gt;
  &lt;div class="col-md-3 addedClass"&gt;
       &lt;label&gt;Vehicle Images&lt;/label&gt;
       &lt;input type="file" name="vehicle_image[{{$i}}][]" multiple="multiple"&gt;
       @if($errors-&gt;has('vehicle_image'))
            &lt;span class="help-block"&gt;
                &lt;strong&gt;{{$errors-&gt;first('vehicle_image')}}&lt;/strong&gt;
            &lt;/span&gt;
       @endif
  &lt;/div&gt;
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>I have got files in the request like this:</p>
  
  <pre><code>"vehicle_image" =&gt; array:2 [▼
      0 =&gt; array:2 [▼
        0 =&gt; "citizenship.jpg"
        1 =&gt; "logo_vehicle.png"
      ]
      1 =&gt; array:2 [▼
        0 =&gt; "ae backend.jpg"
        1 =&gt; "logo_vehicle.png"
      ]
    ]
  </code></pre>
  
  <p>In this case, I have two input fields with 2/2 files. When I have tried to validate mime type for <code>only images</code> like this:</p>
  
  <pre><code>$this-&gt;validate($request,[
             'vehicle_image' =&gt; 'mimes:jpeg,png,bmp,tiff |max:4096'
         ],$messages[
              // error messages 
        ]);
  </code></pre>
  
  <p>I have got following error:</p>
  
  <p><code>FatalThrowableError in ReservationController.php line 67: Cannot use [] for reading</code></p>
  
  <p>Can someone tell me what is wrong with the above code ?
  Suggestions are appreciated.</p>