checkToken($token); if (!$ret) { throw new AppCommonException("トークン不正"); } $this->initialized = true; return $this; } public function initById(string $id) { $this->fetch($id); $this->initialized = true; return $this; } protected function service() { $order = $this->order; $pdf = PDF::loadView('pdf', $order); // はがきサイズを指定 $ret = $pdf->setOption('page-height', 148) ->setOption('page-width', 100) ->setOption('encoding', 'utf-8') ->inline(); $order->status = ReceiptIssuingOrderStatus::DOWNLOAD_DONE; return $ret; } }