title: Laravel Excel download not working
body: <p>The problem is the same as described here <a href="https://stackoverflow.com/questions/31808416/laravel-excel-download-using-controller">Laravel Excel Download using Controller</a></p>
  
  <p>But I just can not believe that there is no method to deal with Excel downloads in Laravel without using another resource. I was already able handle the instant downloads in controller with <code>response()</code> for PDFs.</p>
  
  <p>Mabybe the headers are wrong? My code: </p>
  
  <pre><code>public function getFile($file) {
      $path = storage_path('app/excel/exports/' . $file);
  
      $headers = array('Content-Type' =&gt; File::mimeType($path));
  
      return response()-&gt;download($path, $file, $headers);
  }
  </code></pre>
  
  <p>So the excel file is created and saved correctly in my storage folder (happens before the code above). Then I use an <code>axios.get</code> method to download the file with the function above.</p>
  
  <p>Headers I am getting: </p>
  
  <blockquote>
    <p>Accept-Ranges:bytes
    Cache-Control:public
    Connection:keep-alive
    Content-Disposition:attachment; filename="test_file.xlsx"
    Content-Length:7066
    Content-Type:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</p>
  </blockquote>
  
  <p>But whatever I do or try to change the download just won't start.</p>