Issues (374)

app/Mail/AccountDeleted.php (2 issues)

1
<?php
2
3
namespace App\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Mail\Mailable;
7
use Illuminate\Queue\SerializesModels;
8
9
class AccountDeleted extends Mailable
10
{
11
    use Queueable, SerializesModels;
0 ignored issues
show
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\AccountDeleted: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
12
13
    /**
14
     * @var \Illuminate\Database\Eloquent\Model|null|object|static
15
     */
16
    private $user;
17
18
    /**
19
     * @var mixed
20
     */
21
    private $siteEmail;
22
23
    /**
24
     * @var mixed
25
     */
26
    private $siteTitle;
27
28
    /**
29
     * Create a new message instance.
30
     */
31
    public function __construct($user)
32
    {
33
        $this->user = $user;
34
        $this->siteEmail = config('mail.from.address');
35
        $this->siteTitle = config('app.name');
36
    }
37
38
    /**
39
     * @throws \Exception
40
     */
41
    public function build(): static
42
    {
43
        return $this->from($this->siteEmail)->subject('User Account Deleted')->view('emails.accountDelete')->with(['username' => $this->user->username, 'site' => $this->siteTitle]);
0 ignored issues
show
Bug Best Practice introduced by
The property username does not exist on App\Mail\AccountDeleted. Did you maybe forget to declare it?
Loading history...
44
    }
45
}
46