|
- <?php
-
- namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;;
-
- use App\Logic\ReceiptIssuingOrder\PDFDownLoadManager;
- use App\Models\ReceiptIssuingHTParkingCustomOrder;
- use App\Models\ReceiptIssuingOrder;
-
- class PDFDownLoadManagerHelloTechno extends PDFDownLoadManager
- {
-
- public function __construct(
- protected ReceiptIssuingOrder $order,
- protected ReceiptIssuingHTParkingCustomOrder $customOrder,
- ) {
- parent::__construct($order);
- }
-
- public function initByToken(string $token)
- {
- parent::initByToken($token);
-
- $this->customOrder = ReceiptIssuingHTParkingCustomOrder::whereReceiptIssuingOrderId($this->order->id)->firstOrFail();
- return $this;
- }
-
- public function initById(string $id)
- {
- parent::initById($id);
-
- $this->customOrder = ReceiptIssuingHTParkingCustomOrder::whereReceiptIssuingOrderId($this->order->id)->firstOrFail();
- return $this;
- }
-
- protected function getPDFData()
- {
- return [
- ...parent::getPDFData(),
- ...$this->customOrder->toArray(),
- ];
- }
- }
|