pdfAttachments = $pdfAttachments; $this->rows = $rows; } /** * Get the message envelope. */ public function envelope(): Envelope { return new Envelope( subject: 'Daily Task Report Mail', ); } /** * Get the message content definition. */ public function content(): Content { return new Content( view: 'mail.daily-task-report', with: [ 'rows' => $this->rows, ], ); } /** * Get the attachments for the message. * * @return array */ public function attachments(): array { return collect($this->pdfAttachments) ->map(function ($attachment) { return Attachment::fromPath($attachment['path']) ->as($attachment['name']) ->withMime('application/pdf'); }) ->toArray(); } }