title: How to get image from an nested input array Laravel
body: <p>I am trying to get input value in a nested array like the one showed bellow.But the problem is the image array is missing or if not I don't know how to get the value of the image file.</p>
  
  <p>This is how i want</p>
  
  <pre><code> Array
      (
          [_token] =&gt; 7iSeeTphiVbpQw3iQ8eb1lReMRzxBY8Lt1lKqQea
          [food] =&gt; Array
              (
                  [product[1] =&gt; Array
                      (
                          [name] =&gt; 1
                          [price] =&gt; 10
                          [image]=&gt;Uploaded image here
                      )
              )
  
      )
  </code></pre>
  
  <p>But what i am actually getting is this</p>
  
  <pre><code>Array
  (
      [_token] =&gt; 7iSeeTphiVbpQw3iQ8eb1lReMRzxBY8Lt1lKqQea
      [food] =&gt; Array
          (
              [product[1] =&gt; Array
                  (
                      [name] =&gt; 1
                      [price] =&gt; 10
                  )
  
              [product[2] =&gt; Array
                  (
                      [name] =&gt; 1
                      [price] =&gt; 10
                  )
  
          )
  
  )
  </code></pre>
  
  <p>And my form blade is like this</p>
  
  <pre><code> &lt;form method="POST" action="" enctype="multipart/form-data"&gt;
     {{csrf_field()}}
    &lt;!-----PHP LOOP STARTS HERE ----&gt;
  &lt;select class="form-control" name="food[product[$i][name]]"&gt;                                                    
    &lt;option value="1"&gt;Fried rice&lt;/option&gt;
    &lt;option value="2"&gt;Demo food&lt;/option&gt;
  &lt;/select&gt;
  &lt;input type="text" placeholder="set a price" class="form-control" name="food[product[$i][price]]"&gt;
  &lt;input type="file" placeholder="set a price" class="form-control" name="food[product[$i][image]]"&gt;
   &lt;!-----PHP LOOP ENDS HERE ----&gt;
  &lt;button type='submit'&gt;Submit&lt;/button&gt;
  </code></pre>
  
  <p>Can anyone help me how can i get the image so i can store in folder and save the url to database?? In controller</p>
  
  <p><strong>UPDATE</strong>
  I changed the form</p>
  
  <pre><code>&lt;input type="text" placeholder="set a price" class="form-control" name="product[$i][price]"&gt;
      &lt;input type="file" placeholder="set a price" class="form-control" name="product[$i][image]"&gt;
  </code></pre>
  
  <p>In reponse i am getting</p>
  
  <pre><code>[product] =&gt; Array
          (
              [1] =&gt; Array
                  (
                      [name] =&gt; 1
                      [price] =&gt; 10
                      [image] =&gt; Illuminate\Http\UploadedFile Object
                          (
                              [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 
                              [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; dell-inspiron-3567-notebook-original-imaetu5ch98vzge5.jpeg
                              [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; image/jpeg
                              [size:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 40705
                              [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 0
                              [hashName:protected] =&gt; 
                              [pathName:SplFileInfo:private] =&gt; C:\xampp\tmp\php17B2.tmp
                              [fileName:SplFileInfo:private] =&gt; php17B2.tmp
                          )
  
                  )
  </code></pre>
  
  <p>After doing that i can see the image is being uploaded. Now how to capture that image ??
  If i try foreach loop that image is getting missing. I am getting undefined index for image.
  so how shall i proceed ?</p>