Q:

Laravel Excel download not working

The problem is the same as described here Laravel Excel Download using Controller
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 response() for PDFs. 
Mabybe the headers are wrong?  My code: 
public function getFile($file) {
    $path = storage_path('app/excel/exports/' .  $file);

    $headers = array('Content-Type' => File::mimeType($path));

    return response()->download($path, $file, $headers);
}

So the excel file is created and saved correctly in my storage folder (happens before the code above).  Then I use an axios.get method to download the file with the function above. 
Headers I am getting: 

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

But whatever I do or try to change the download just won't start. 

A:

I manged to solve it. 
It seems to be not possible to solve this with a simple axios.get request to the route.  Instead I needed to open the route directly with a link.  
Did not work with:
HTML
    <button @click="downloadExcel()">Download Table as Excel File</button>
downloadExcel() {
    axios.get('/customers/export');
}

Simple solution (instead of just using axios.get):
<a :href="/customers/export"><button>Download Table as Excel File</button></a>

So it would also be possible to open the route after the axios request with:
downloadExcel() {
    let newWindow = window.open();
    axios.get('/customers/export')
       .then(response => {
         newWindow.location = 'http://' + window.location.hostname + '/customers/export';
       });
}

