From 4cbdc8b521d9af66c0b30ca6b228f2a2911609b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 20 Aug 2021 15:38:15 +0200 Subject: [PATCH] Construct & update `entity` if `invoices` is available in `context` --- app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php index d43465d0ed60..b9134d52620b 100644 --- a/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php +++ b/app/Services/PdfMaker/Designs/Utilities/DesignHelpers.php @@ -36,6 +36,11 @@ trait DesignHelpers $this->entity = $this->context['entity']; } + if (isset($this->context['invoices'])) { + $this->invoices = $this->context['invoices']; + $this->entity = $this->invoices->first(); + } + $this->document(); return $this;