body = $value; } } public string $pdf; public string $xml; /** * Create a new message instance. */ public function __construct(protected Invoice $invoice) { $pdf = new PdfController(); $this->pdf = $pdf->attachInvoice($invoice->id); $xml = new EController(); $this->xml = $xml->attachInvoice($invoice->id); } /** * Get the message content definition. */ public function content(): Content { return new Content( html: 'mail.invoice.sent', with: ['html' => $this->body], ); } /** * Get the attachments for the message. */ public function attachments(): array { return [ Attachment::fromData(fn() => $this->pdf, __('invoice.Invoice') . '_' . $this->invoice->number . '.pdf') ->withMime('application/pdf'), Attachment::fromData(fn() => $this->xml, __('invoice.Invoice') . '_' . $this->invoice->number . '.xml') ->withMime('application/xml'), ]; } }