title: Getting empty object on multiple image upload
body: <p>I am getting empty object when I try to upload multiple images.<br>
  It is throwing <code>validation.required</code> error, that means I am not not getting <code>images</code> object.<br>
  <strong>image_upload.blade.php</strong></p>
  
  <pre><code>&lt;div class="modal fade" id="ImageUploadDataModal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false"&gt;
                  &lt;div class="modal-dialog" role="document" style="width: 50%;"&gt;
                      &lt;div class="modal-content"&gt;
                          &lt;div class="modal-header"&gt;
                              &lt;button type="button" class="close" data-dismiss="modal"&gt;&amp;times;&lt;/button&gt;
                              &lt;h4 class="modal-title" id="defaultModalLabel"&gt;Upload Images&lt;/h4&gt;
                          &lt;/div&gt;
                          &lt;div class="modal-body"&gt;
                              &lt;form name="img_upload" id="upload_img_form" enctype="multipart/form-data"&gt;
                                  &lt;input type="hidden" name="_token" value="{{{ csrf_token() }}}" /&gt; 
                                  &lt;input type="hidden" name="Type" value="B" /&gt; 
                                  &lt;div class="row"&gt;
                                      &lt;div class="col-sm-12"&gt;
                                          &lt;label for="UploadImages"&gt;Select Images&lt;/label&gt;
                                          &lt;div class="form-group form-group1" &gt;
                                              &lt;div class="form-line"&gt;
                                                  &lt;input type="file" name="images[]" class="imgage_change" id="UploadImgages"  multiple&gt; 
                                              &lt;/div&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                  &lt;/div&gt;              
                              &lt;/form&gt;
                              &lt;div class="clearfix"&gt;&lt;/div&gt; 
                          &lt;/div&gt;
                          &lt;div class="modal-footer"&gt;
                              &lt;button type="button" class="btn btn-md btn-success waves-effect upload_images" id="btnImport" style="margin: 0px;" data-url="{{URL::to('upload/images')}}" data-frmid="#upload_img_form" data-modalname="#ImageUploadDataModal"&gt;UPLOAD&lt;/button&gt;
                              &lt;button type="button" class="btn btn-md  btn-danger waves-effect clearpoup" data-dismiss="modal" &gt;CLOSE&lt;/button&gt;
                          &lt;/div&gt; 
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p><strong>Ajax File</strong></p>
  
  <pre><code>$(document).on("click", '.upload_images', function () {
                      var aurl = $(this).data('url');
                      var frm = $(this).data('frmid');
                      var modalName = $(this).data('modalname');
                      var $form = $(frm)[0]; // You need to use standard javascript object here
                      var formData = new FormData($form);               
                      $.ajax({
                          type: "POST",
                          url: aurl,
                          data: formData,
                          cache: false,
                          processData: false, // Don't process the files
                          contentType: false, // Set content type to false as jQuery will tell the server its a query string request
                          headers: {
                              'X-CSRF-TOKEN': $('meta[name="_token"]').attr('content')
                          },
                          beforeSend: function () {
                              $('.upload_images').attr("disabled", true);
                          },
                          success: function (response) {
                              if (modalName != "") {
                                  if (response.error_status == true)
                                  {
                                      $(modalName).modal('toggle');
                                      $('.upload_images').attr("disabled", false);
                                      oTable.draw(false);
                                  } else {
                                      $('.upload_images').attr("disabled", false);
                                      swal("Error!", response.message, "error");
                                  }
                              } else {
                                  window.location.reload();
                              }
                          },
                          error: function (response) {
                              $('.upload_images').attr("disabled", false);
                              var errors = $.parseJSON(response.responseText);
                              resetModalFormErrors();
                              associate_errors(errors, $form);
                          }
                      });
  
                  });
  </code></pre>
  
  <p><strong>UploadImagesController.php</strong></p>
  
  <pre><code>public function store(Request $request)
      {
  
  
        exit();
          $objValidation = Validator::make($request-&gt;all(), [
              'images' =&gt; 'required',
  
          ]);
  
          if ($objValidation-&gt;fails()) {
              $errors = $objValidation-&gt;errors();
                  return response()-&gt;json($errors, 422);
              // return Response::json(['title' =&gt; 'Error!', 'error_status' =&gt; FALSE, 'message' =&gt; 'Select at least one image, only JPG, and PNG are allowed!']);
          }
  
          $data =[];
          if ($request-&gt;hasfile('images')) {
  
              foreach ($request-&gt;file('images') as $image) {
                  $name = $image-&gt;getClientOriginalName();
                  $image-&gt;move( public_path('/uploaded_images'), $name);
                  $image-&gt;save();
                  $path = public_path('/uploaded_images');  
                  exit();
                  $data[] = $name;
              }
          }
  
          $image = new Image();
          $image-&gt;img_url = json_encode($data);
          $image-&gt;save();
    }
  }
  </code></pre>