title: Formdata is empty - laravel 5.4
body: <p><strong>Hi Friends,</strong><br>
  I am trying to upload an image using ajax in laravel 5.4  </p>
  
  <p><strong>Issue</strong> :<br>
  Formdata is empty on server-side  </p>
  
  <p><strong>CODE</strong> :  </p>
  
  <p><strong>View</strong> :  </p>
  
  <pre><code>&lt;form role="form" action="{{route('auth.upload')}}" method="post" enctype="multipart/form-data" id="form3"&gt;
       {{ csrf_field() }}
       &lt;h3&gt;Upload Logo&lt;/h3&gt;
  
       &lt;div class="form-group"&gt;
            &lt;label class="custom-file upload-image"&gt;
            &lt;input type="file" id="image" name="image" class="custom-file-input"&gt;
            &lt;span class="custom-file-control"&gt;&lt;/span&gt;
            &lt;/label&gt;
        &lt;/div&gt;
        &lt;button type="submit" class="btn btn-upload"&gt;Save Image&lt;/button&gt;
  &lt;/form&gt;  
  </code></pre>
  
  <p><strong>JS</strong> :  </p>
  
  <pre><code>$('#form3').on('submit',function(e){
      e.preventDefault();
  
      var url = $(this).attr('action'),
      post = $(this).attr('method'),
      data = new FormData(this);
  
      $.ajax({
          url: url,
          method: post,
          data: data,
          success: function(data){
              console.log(data);
          },
          error: function(xhr, status, error){
              alert(xhr.responseText);
          },
          processData: false,
          contentType: false
      });
  });  
  </code></pre>
  
  <p><strong>Route</strong> :  </p>
  
  <pre><code>Route::post('home/form3', 'HomeController@store')-&gt;name('auth.upload');  
  </code></pre>
  
  <p><strong>Controller</strong> :  </p>
  
  <pre><code>public function store(Request $request){
      if ($request-&gt;ajax()) {
  
          return $request-&gt;all(); // THIS IS RETURNING EMPTY OBJECT
  
          if ($request-&gt;hasFile('image')) {
  
              $name = $request-&gt;image-&gt;getClientOriginalName();
              $request-&gt;image-&gt;storeAs('public/upload',$name);
  
              $company = new Company;
              $url = Storage::url($name);
              $company-&gt;update(['image'=&gt;$url]);
  
              return response(['msg'=&gt;'image uploaded']);
          }else{
              return response(['msg'=&gt;'No file has selected']);
          } 
      }
  }  
  </code></pre>
  
  <p><strong>return response from server side is :</strong>  </p>
  
  <pre><code>Object {_token: "zFKgoBkdjaIswMG5X0fOyVtaGSYMs84iPDtJA4F5", image: Object}
     image : Object
     _token : "zFKgoBkdjaIswMG5X0fOyVtaGSYMs84iPDtJA4F5"
     __proto__ : Object  
  </code></pre>
  
  <p>I can see only token is returning but not data of uploaded image. If I submit form without using ajax then it is working fine.</p>
  
  <p><strong>Output if submitted without using ajax (this is the output I am expecting even submitted using ajax):</strong>  </p>
  
  <pre><code>array:2 [▼
    "_token" =&gt; "eVEjl9UW4rU69oz1lIIiuNABZVpRJFldDST02Nje"
    "image" =&gt; UploadedFile {#229 ▼
      -test: false
      -originalName: "empty-normal.png"
      -mimeType: "image/png"
      -size: 85494
      -error: 0
      #hashName: null
      path: "C:\xampp\tmp"
      filename: "php917E.tmp"
      basename: "php917E.tmp"
      pathname: "C:\xampp\tmp\php917E.tmp"
      extension: "tmp"
      realPath: "C:\xampp\tmp\php917E.tmp"
      aTime: 2017-05-18 11:17:11
      mTime: 2017-05-18 11:17:11
      cTime: 2017-05-18 11:17:11
      inode: 0
      size: 85494
      perms: 0100666
      owner: 0
      group: 0
      type: "file"
      writable: true
      readable: true
      executable: false
      file: true
      dir: false
      link: false
      linkTarget: "C:\xampp\tmp\php917E.tmp"
  </code></pre>
  
  <p>}
      ]  </p>
  
  <p>Can any one help me in solving this issue ?</p>
  
  <p>**THANKS IN ADVANCE...</p>