The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\WelcomeEmail: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
13
14
/**
15
* @var User
16
*/
17
private $user;
18
19
/**
20
* @var mixed
21
*/
22
private $siteEmail;
23
24
/**
25
* @var mixed
26
*/
27
private $siteTitle;
28
29
/**
30
* Create a new message instance.
31
*/
32
public function __construct(User $user)
33
{
34
$this->user = $user;
35
$this->siteEmail = config('mail.from.address');
36
$this->siteTitle = config('app.name');
37
}
38
39
/**
40
* Build the message.
41
*/
42
public function build(): static
43
{
44
return $this->from($this->siteEmail)->subject('Welcome to '.$this->siteTitle)->view('emails.welcome')->with(['username' => $this->user->username, 'site' => $this->siteTitle]);