Export didn't work

Hi,
i can't make the user to dowload the file but the link is good and when i put it on an other tab of my google, it work :

there is my code in app\Services\ExportService.php :
public static function export($datas, $type)
    {

        //... my code
    
  $writer->save($excelFile);
  $filename = $name . now()->format('Y-m-d_H-i-s') . '.xlsx';
  $filePath = 'public/' . $filename;
  Storage::disk('local')->put($filePath, file_get_contents($excelFile));
  unlink($excelFile);
  return response()->download(storage_path('app/' . $filePath), $filename);
    }

if i do
dd(return response()->download(storage_path('app/' . $filePath), $filename));


it will send me a link that will download the file if I put it on another Google tab
Was this page helpful?