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 ExportAnalyticToExcelController
$exportFileName = 'bookingData.csv';
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver === 's3'){
return response([ 'src' => AWSS3Helper::S3($exportFileName, $exportsAnalyticBookingTransactions) ]);
return response([ 'src' => AWSS3Helper::S3Exportable($exportFileName, $exportsAnalyticBookingTransactions) ]);
}
else{
$response = $exportsAnalyticBookingTransactions->download($exportFileName, Excel::CSV, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
@@ -42,7 +42,7 @@ class ExportAnalyticToExcelController
$exportFileName = 'billingData.csv';
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver === 's3'){
return response([ 'src' => AWSS3Helper::S3($exportFileName, $exportsAnalyticBillingTransactions) ]);
return response([ 'src' => AWSS3Helper::S3Exportable($exportFileName, $exportsAnalyticBillingTransactions) ]);
}
else{
$response = $exportsAnalyticBillingTransactions->download($exportFileName, Excel::CSV, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);