Export pdf file from Laravel Vapor through S3 bucket (code sync from exchange-2.0)

This commit is contained in:
Dillon Ngo
2024-06-18 12:22:46 +08:00
parent cef88f8274
commit 06e36bb754
18 changed files with 155 additions and 40 deletions
@@ -32,7 +32,7 @@ class ExportCustomersWalletTransactionToExcelController
$exportFileName = $company_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']);