title: Laravel array with illuminate objects
body: <p>I am trying to pass images from AJAX to back-end and upload them, save their names into the database.</p>
  
  <p>My AJAX code:</p>
  
  <pre><code>var form_data = new FormData($('.updateForm')[0]);
  
              $.ajax({
  
                  method: "POST",
                  url: "/updateMyPost",
                  data: form_data,
                  cache : false,
                  contentType: false,
                  processData: false,
                  success: function (result) {
  
                      console.log(result);
  
                  }
  
              });
  </code></pre>
  
  <p>Laravel function to upload the files:</p>
  
  <pre><code>public function updateMyPost(Request $request){
  
          $name = $request-&gt;input('text');
  
          $images = $request-&gt;file('images');
  
          foreach($images as $image){
  
              $image_name = time() . $image-&gt;getClientOriginalName();
  
              $path = public_path('images');
  
              $img-&gt;move($path,$image_name);
  
          }  
  
      }
  </code></pre>
  
  <p>And this is what $request->file("images") gives to me when I print it out.</p>
  
  <pre><code>Array
  (
      [0] =&gt; Illuminate\Http\UploadedFile Object
          (
              [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 
              [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; images.jpg
              [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; image/jpeg
              [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 0
              [hashName:protected] =&gt; 
              [pathName:SplFileInfo:private] =&gt; C:\xampp\tmp\phpAB87.tmp
              [fileName:SplFileInfo:private] =&gt; phpAB87.tmp
          )
  
      [1] =&gt; Illuminate\Http\UploadedFile Object
          (
              [test:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 
              [originalName:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; iphonex-TA.jpg
              [mimeType:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; image/jpeg
              [error:Symfony\Component\HttpFoundation\File\UploadedFile:private] =&gt; 0
              [hashName:protected] =&gt; 
              [pathName:SplFileInfo:private] =&gt; C:\xampp\tmp\phpAB88.tmp
              [fileName:SplFileInfo:private] =&gt; phpAB88.tmp
          )
  
  )
  </code></pre>
  
  <p>How can I get each image name and also upload them?</p>