mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-28 08:53:59 +00:00
Merge branch 'dillon/34.1-jenkins-vapor' into vapor/development
This commit is contained in:
@@ -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);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user