I am generating a XLSX file using PhpSpreadSheet and downloading it successfully by visiting a specific route like this:
$writer = new Xlsx($spreadsheet);
$writer->save('TTD-HMO-ARSUB.xlsx');
return response()->download('TTD-HMO-ARSUB.xlsx');
I see that the TTD-HMO-ARSUB.xlsx file gets stored in my Laravel project's public folder.
The problem here is that I need to send some data from an Angular app through a POST request and include that data on the Excel file, so I can't just visit that route. So I decided to try to get an download URL for the file created. I have tried with these urls with no success, only 404s:
http://eiba.com/public/index.php/TTD-HMO-ARSUB.xlsx
Is there a way to access this file from a URL? Do I need to store it on another location, how?