I have a button that creates and csv , i want it to a return a trigger to download the file to the user. currently i'm getting the file content as the response data. in my controller i use:
Storage::put($filepath, $fileconent);
$headers = [
'Content-Type' => 'Content-Type: text/csv',
];
return Storage::download($filepath, $filename, $headers );
(Storage::download adds the 'Content-Disposition: attachment; filename=filename' header)
what am i missing? thanks