領収証発行サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1KB

  1. <?php
  2. namespace App\Logic\ReceiptIssuingOrder\Custom\HelloTechno;;
  3. use App\Logic\ReceiptIssuingOrder\PDFDownLoadManager;
  4. use App\Models\ReceiptIssuingHTParkingCustomOrder;
  5. use App\Models\ReceiptIssuingOrder;
  6. class PDFDownLoadManagerHelloTechno extends PDFDownLoadManager
  7. {
  8. public function __construct(
  9. protected ReceiptIssuingOrder $order,
  10. protected ReceiptIssuingHTParkingCustomOrder $customOrder,
  11. ) {
  12. parent::__construct($order);
  13. }
  14. public function initByToken(string $token)
  15. {
  16. parent::initByToken($token);
  17. $this->customOrder = ReceiptIssuingHTParkingCustomOrder::whereReceiptIssuingOrderId($this->order->id)->firstOrFail();
  18. return $this;
  19. }
  20. public function initById(string $id)
  21. {
  22. parent::initById($id);
  23. $this->customOrder = ReceiptIssuingHTParkingCustomOrder::whereReceiptIssuingOrderId($this->order->id)->firstOrFail();
  24. return $this;
  25. }
  26. protected function getPDFData()
  27. {
  28. return [
  29. ...parent::getPDFData(),
  30. ...$this->customOrder->toArray(),
  31. ];
  32. }
  33. }