add command for sending do to vt

This commit is contained in:
omair saleh
2021-11-25 01:25:28 +08:00
parent c23a0e60a3
commit 6e35fe1d76
+4 -2
View File
@@ -73,9 +73,11 @@ class EmailDoToVTCommand extends Command
foreach ($bookings as $booking) {
$file = $booking->documents()->where('document_type', DocumentType::SUPPLIER_DELIVER_ORDER)->first()->files()->first();
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');
if(!file_exists(Storage::disk('documents')->path($file->file->file_info->original->file))){
echo 'file doesnot exist';
}
$zip->addFile(Storage::disk('documents')->path($file->file->file_info->original->file), $booking->created_at->format('d_m_Y').'_'.$booking->marking.'.pdf');
}
$zip->close();