Laravel Vapor - debug reading from S3 storage

This commit is contained in:
Dillon Ngo
2024-04-26 15:27:06 +08:00
parent 931a0f6bf5
commit a93b8091b2
@@ -75,7 +75,13 @@ class BulkDownloadCustomerInvoicesLogic
$zipDataStr .= $fileContent;
}
$zipFileName = "invoices_{$startDate}_to_{$endDate}_{$company->reference}.zip";
$zipDirectory = storage_path('app/bulk_invoice'); // Update this with the actual directory path
if (!file_exists($zipDirectory)) {
mkdir($zipDirectory, 0755, true);
}
$zipFileName = "{$zipDirectory}/invoices_{$startDate}_to_{$endDate}_{$company->reference}.zip";
if ($zip->open($zipFileName, ZipArchive::CREATE | ZipArchive::OVERWRITE)) {
$zip->addFromString($zipFileName, $zipDataStr);