has('preview')) { return $this->invoiceService->getPdfData($invoice); } return $invoice->getGeneratedPDFOrStream('invoice'); } }