user_credit = $user_credit; $this->subject = __('email.credit_title'); } public function build() { $title = 'Hallo '; $copy1line = __('email.credit_copy1line'); if(isset($this->user_credit->user->account)){ $title .= $this->user_credit->user->account->m_first_name.","; } $filename = $this->user_credit->filename; $disk = $this->user_credit->disk; $path = $this->user_credit->getDownloadPath(); if (!Storage::disk($disk)->exists($path)) { return; } $file = Storage::disk($disk)->path($path); $file = str_replace('//', '/', $file); $mime = Storage::disk($disk)->mimeType($path); return $this->view('emails.blank')->with([ 'title' => $title, 'copy1line' => $copy1line, ])->attach($file,[ 'as' => $filename, 'mime' => $mime, ]); // attach file; } }