title: Laravel - Force download with response()->download($fileLocation) not working
body: <p>I'm creating a downloads functionality with Laravel. When the user clicks on the 'download' button, I initiate an ajax call to the controller which looks like this -</p>
  
  <pre><code>public function download(Resource $resource) {
      // Force download of the file
      $file_to_download   = 'https://data.domain.com/downloads/' . $resource-&gt;file_name;
      $temp_file_location =   public_path('/tmp_files/' . $resource-&gt;file_name);
      copy($file_to_download, $temp_file_location);
      return response()-&gt;download($temp_file_location)-&gt;deleteFileAfterSend(true);
  }
  </code></pre>
  
  <p>Chrome's inspector shows that the response gets populated with the contents of the file, but it won't trigger the actual download. </p>
  
  <p>I've been trying to find an answer, but have had no success so far. Would really appreciate your help.</p>
  
  <p>Thank you for your time.</p>