mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-21 13:33:57 +00:00
Laravel Vapor - Fix a problem with fetching file from S3 bucket path inconsistency
This commit is contained in:
+3
-3
@@ -56,13 +56,13 @@ class BulkDownloadSupplierWhiteFormsLogic
|
||||
foreach($groups as $group) {
|
||||
$document = $group->documents()->where('document_type', DocumentType::CURRENCY_VENDOR_ORDER)->whereNull('deleted_at')->first()->files()->first();
|
||||
$created_at = $group->created_at->format('Y-m-d');
|
||||
Log::info('BulkDownloadSupplierWhiteFormsLogic processing: ' . 'documents/'.$document->file->file_info->original->file);
|
||||
Log::info('BulkDownloadSupplierWhiteFormsLogic processing: ' . $document->file->file_info->original->file);
|
||||
if(!Storage::disk('s3')->exists($document->file->file_info->original->file))
|
||||
{
|
||||
Log::info('BulkDownloadSupplierWhiteFormsLogic file does not exist: ' . 'documents/'.$document->file->file_info->original->file);
|
||||
Log::info('BulkDownloadSupplierWhiteFormsLogic file does not exist: ' . $document->file->file_info->original->file);
|
||||
}
|
||||
else{
|
||||
$fileContent = Storage::disk('s3')->get('documents/'.$document->file->file_info->original->file);
|
||||
$fileContent = Storage::disk('s3')->get($document->file->file_info->original->file);
|
||||
$zip->addFromString('invoice-' . $created_at . "_" . $group->amount . "_" . $group->reference . '.pdf', $fileContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class PaymentProofUploadedEmail extends AbstractEmail
|
||||
// $filesystemDriver = Storage::getDefaultDriver();
|
||||
// if($filesystemDriver === 's3'){
|
||||
// $fileContent = null;
|
||||
// $fileContent = Storage::disk('s3')->get('documents/' . $file_path);
|
||||
// $fileContent = Storage::disk('s3')->get($file_path);
|
||||
// if ($fileContent) {
|
||||
// $mailMessage->attachData($fileContent, 'invoice.pdf', [
|
||||
// 'mime' => 'application/pdf',
|
||||
|
||||
Reference in New Issue
Block a user