From c23a0e60a347b3dd0ee654f0ea2b0fc42e95a284 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 25 Nov 2021 01:24:02 +0800 Subject: [PATCH] add command for sending do to vt --- app/Console/Commands/EmailDoToVTCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/EmailDoToVTCommand.php b/app/Console/Commands/EmailDoToVTCommand.php index 89f2ed14..d23eb44b 100644 --- a/app/Console/Commands/EmailDoToVTCommand.php +++ b/app/Console/Commands/EmailDoToVTCommand.php @@ -73,8 +73,8 @@ class EmailDoToVTCommand extends Command foreach ($bookings as $booking) { $file = $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first(); - if(!$zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), $booking->created_at->format('d_m_Y').'_'.$booking->marking.'.pdf')){ - echo 'Could not add file to ZIP: ' . $file; + if(file_exists(Storage::disk('documents')->path($file->file->file_info->original->file))){ + $zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), $booking->created_at->format('d_m_Y').'_'.$booking->marking.'.pdf'); } }