Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development

This commit is contained in:
Dillon Ngo
2024-04-29 15:37:54 +08:00
3 changed files with 18 additions and 3 deletions
@@ -10,6 +10,7 @@ use App\Classes\ValueObjects\Constants\DocumentType;
use App\Models\Document;
use Mccarlosen\LaravelMpdf\Facades\LaravelMpdf;
use Webklex\PDFMerger\Facades\PDFMergerFacade as PDFMerger;
use Illuminate\Support\Facades\Storage;
class CreateInvoiceDocumentProcessor
{
@@ -52,8 +53,14 @@ class CreateInvoiceDocumentProcessor
$order_pdf->save(storage_path('app/documents/temp.pdf'));
$oMerger->addPDF(storage_path('app/documents/temp.pdf'), 'all');
$filesystemDriver = Storage::getDefaultDriver();
foreach ($purchaseOrderDocuments as $document){
$oMerger->addPDF(storage_path('app/documents/'.$document->files()->first()->file->file_info->original->file), 'all');
$localFilePath = storage_path('app/documents/' . $document->files()->first()->file->file_info->original->file);
$oMerger->addPDF($localFilePath, 'all');
if($filesystemDriver === 's3'){
$filePathForS3 = 'documents/'.$document->files()->first()->file->file_info->original->file;
Storage::disk('s3')->put($filePathForS3, file_get_contents($localFilePath));
}
}
$oMerger->merge();
@@ -7,6 +7,7 @@ use App\Models\User;
use App\Models\File;
use App\Models\UserEmailVerification;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Facades\Storage;
class PaymentProofUploadedEmail extends AbstractEmail
{
@@ -40,7 +41,14 @@ class PaymentProofUploadedEmail extends AbstractEmail
foreach ($file_info as $fileCount => $fileVal) {
if (isset($fileVal->original)) {
$file_path = $fileVal->original->file;
$attachedFile = storage_path('app/documents/' . $file_path);
// $filesystemDriver = Storage::getDefaultDriver();
// if($filesystemDriver === 's3'){
// $fileContent = Storage::disk('s3')->get('documents/'.$file_path);
// }
// else{
// $attachedFile = storage_path('app/documents/' . $file_path);
// }
}
}
+1 -1
View File
@@ -55,7 +55,7 @@ environments:
- exchange-default-development
- exchange-high_priority-development
database: cief-rds-mysql
storage: exchange-2.0-production
storage: exchange-2.0-development
runtime: 'docker'
timeout: 180
build: