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