travel_user_booking_fewo = $travel_user_booking_fewo; $this->notice = $notice; $this->subject = __('STERN TOURS Mietbestätigung FEWO'); } public function build() { $salutation = __('Dear customer').","; if($this->travel_user_booking_fewo->travel_user){ if($this->travel_user_booking_fewo->travel_user->salutation_id == 1){ $salutation = __('Dear Sir')." ".$this->travel_user_booking_fewo->travel_user->last_name.","; }else{ $salutation = __('Dear Mrs')." ".$this->travel_user_booking_fewo->travel_user->last_name.","; } } $file1 = array( 'path' => Storage::disk('public')->path("pdf/Stern-Tours-Mietbedingungen.pdf"), 'name' => 'Stern-Tours-Mietbedingungen.pdf', 'mine' => 'application/pdf', ); $file2 = array( 'path' => $this->travel_user_booking_fewo->getInvoicePathFile(), 'name' => 'Stern-Tours-'.$this->travel_user_booking_fewo->getInvoiceFileName(), 'mine' => 'application/pdf', ); return $this->view('emails.invoice') ->with([ 'salutation' => $salutation, 'copy1line' => "herzlichen Dank für Ihre Online-Buchung vom ".$this->travel_user_booking_fewo->booking_date.", hiermit bestätigen wir verbindlich Ihre Anmietung wie folgt:", 'copy2line' => '', 'notice' => $this->notice, 'greetings' => __('Best regards'), 'model' => $this->travel_user_booking_fewo, ]) ->attach($file1['path'], [ 'as' => $file1['name'], 'mime' => $file1['mine'], ]) ->attach($file2['path'], [ 'as' => $file2['name'], 'mime' => $file2['mine'], ]); } }