data = $data; } /** * Build the message. */ // public function build(): self // { // return $this->view('mail.template'); // } public function envelope(): Envelope { return new Envelope( subject: $this->data['subject'], ); } /** * Get the message content definition. */ public function content(): Content { return new Content( view: 'mail.template' ); } // /** // * Get the attachments for the message. // * // * @return array // */ public function attachments(): array { $attachments = []; if (isset($this->data['documentPaths'])) { foreach ($this->data['documentPaths'] as $path) { $attachments[] = Attachment::fromPath($path); } } if (isset($this->data['mergePdf'])) { $attachments[] = Attachment::fromPath($this->data['mergePdf']); } return $attachments; } }