Export pdf file from Laravel Vapor through S3 bucket

This commit is contained in:
Dillon Ngo
2024-06-18 11:38:43 +08:00
parent 38aa670528
commit fcaee29be3
8 changed files with 106 additions and 31 deletions
@@ -29,7 +29,7 @@ class ExportCustomersWalletTransactionToExcelController
$exportFileName = $request->route('marking') . '-wallet-' . ($request->route('is_precise') == 'true' ? 'precise-' : '') . 'transaction-history.xls';
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver === 's3'){
return response([ 'src' => AWSS3Helper::S3($exportFileName, $exportsTransactions) ]);
return response([ 'src' => AWSS3Helper::S3Exportable($exportFileName, $exportsTransactions) ]);
}
else{
$response = $exportsTransactions->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);