From 224faf73ced0bf26fba21c3444493ac3248e7a8c Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 27 Jul 2017 13:17:41 +0300 Subject: [PATCH] Download as zip if less than 10 PDFs --- app/Jobs/DownloadInvoices.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Jobs/DownloadInvoices.php b/app/Jobs/DownloadInvoices.php index be731c178fe9..9a7062ebe49e 100644 --- a/app/Jobs/DownloadInvoices.php +++ b/app/Jobs/DownloadInvoices.php @@ -46,7 +46,7 @@ class DownloadInvoices extends Job implements ShouldQueue public function handle(UserMailer $userMailer) { // if queues are disabled download a zip file - if (config('queue.default') === 'sync') { + if (config('queue.default') === 'sync' || count($this->invoices) <= 10) { $zip = Archive::instance_by_useragent(date('Y-m-d') . '-Invoice_PDFs'); foreach ($this->invoices as $invoice) { $zip->add_file($invoice->getFileName(), $invoice->getPDFString());