formData = $formData; } public function enquiryform() { $viewPath = 'accessskills.emails.enquiry-submitted'; if (view()->exists($viewPath)) { return $this->subject('Received a new online enquiry from our website.') ->markdown($viewPath, $this->formData); } else { return $this->subject('Received a new online enquiry from our website.') ->view('emails.enquiry-submitted', $this->formData); } } public function enquiryresponse() { $viewPath = 'accessskills.emails.enquiry-response'; if (view()->exists($viewPath)) { return $this->subject('Thank you from ' . env('APP_NAME')) ->markdown($viewPath, $this->formData); } else { return $this->subject('Thank you from ' . env('APP_NAME')) ->view('emails.enquiry-response', $this->formData); } } }