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
@@ -29,7 +29,7 @@ class ExportCompanyModuleSummaryController
$exportFileName = 'customerid-markingno.xls';
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver === 's3'){
return response([ 'src' => AWSS3Helper::S3($exportFileName, $exportsCompanyModuleSummary) ]);
return response([ 'src' => AWSS3Helper::S3Exportable($exportFileName, $exportsCompanyModuleSummary) ]);
}
else{
$response = $exportsCompanyModuleSummary->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
@@ -45,7 +45,7 @@ class ExportCompanyModuleSummaryController
$exportFileName = $customer_marking . '_order_summary.xls';
$filesystemDriver = Storage::getDefaultDriver();
if($filesystemDriver === 's3'){
return response([ 'src' => AWSS3Helper::S3($exportFileName, $exportsOrderSummaryByMarking) ]);
return response([ 'src' => AWSS3Helper::S3Exportable($exportFileName, $exportsOrderSummaryByMarking) ]);
}
else{
$response = $exportsOrderSummaryByMarking->download($exportFileName, Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);