add command for sending do to vt

This commit is contained in:
omair saleh
2021-11-25 01:03:43 +08:00
parent 3f784daf82
commit be8af08f67
+3 -1
View File
@@ -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();