The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\ContactUs: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
12
13
public string $mailFrom;
14
15
public string $mailBody;
16
17
public string $mailTo;
18
19
/**
20
* Create a new message instance.
21
*/
22
public function __construct($mailTo, $mailFrom, $mailBody)
23
{
24
$this->mailTo = $mailTo;
25
$this->mailFrom = $mailFrom;
26
$this->mailBody = $mailBody;
27
}
28
29
/**
30
* Build the message.
31
*
32
*
33
* @throws \Exception
34
*/
35
public function build(): static
36
{
37
return $this->from($this->mailTo)->subject('Contact form submitted')->replyTo($this->mailFrom)->view('emails.contactUs')->with(['mailBody' => $this->mailBody]);