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);
}
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);
}