user = $user; $this->booking = $booking; $this->file = $file; } public function toMail() { $attachedFile = null; $file_info = $this->file->getFileAttribute($this->file)->file->file_info; foreach ($file_info as $fileCount => $fileVal) { if (isset($fileVal->original)) { $file_path = $fileVal->original->file; $attachedFile = storage_path('app/documents/' . $file_path); } } return (new MailMessage) ->subject('Transfer Completed (REF: ' . $this->booking->marking . ')') // ->attach($attachedFile) // todo-new: add attachement ->view('emails.accounts.payment_proof_email', ['user' => $this->user, 'booking' => $this->booking]); } }