From be8af08f67aed7a3d68206ada75f93ba06ebd2af Mon Sep 17 00:00:00 2001 From: omair saleh Date: Thu, 25 Nov 2021 01:03:43 +0800 Subject: [PATCH] add command for sending do to vt --- app/Console/Commands/EmailDoToVTCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/EmailDoToVTCommand.php b/app/Console/Commands/EmailDoToVTCommand.php index cf5100a6..aa5c7cf0 100644 --- a/app/Console/Commands/EmailDoToVTCommand.php +++ b/app/Console/Commands/EmailDoToVTCommand.php @@ -72,7 +72,9 @@ class EmailDoToVTCommand extends Command foreach ($bookings as $booking) { $file = $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first(); - $zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), $booking->created_at->format('d_m_Y').'_'.$booking->marking.'.pdf'); + 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; + } } dd($zip); $zip->close();