title: laravel file uploading using json
body: <p>I am using laravel 5. I have did the following code to post data using json to my controller. But I cannot make file uploading by this manner.</p>
  
  <pre><code>e.preventDefault();
  $.ajax({
      type: 'POST',
      cache: false,
      dataType: 'JSON',
      url: 'tasks',
      data: $('#my_form').serialize(),
      success: function(data) {
          console.log(data);
      },
  });
  </code></pre>
  
  <p>I have the following html code to upload files.</p>
  
  <pre><code>&lt;input type="text" name="name" value="" /&gt;
  &lt;input type="text" name="name" value="" /&gt;
  &lt;input type="file" class="form-control" name="documents[]" multiple&gt;
  </code></pre>
  
  <p>How can I send file using json in laravel? I have did many search but I cant get proper solution</p>