AccountExpired   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 9
dl 0
loc 29
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 3 1
A __construct() 0 5 1
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 AccountExpired extends Mailable
10
{
11
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\AccountExpired: $collectionClass, $id, $relations, $class, $keyBy
Loading history...
12
13
    public $user;
14
15
    private $siteEmail;
16
17
    private $siteTitle;
18
19
    /**
20
     * Create a new message instance.
21
     */
22
    public function __construct($user)
23
    {
24
        $this->user = $user;
25
        $this->siteEmail = config('mail.from.address');
26
        $this->siteTitle = config('app.name');
27
    }
28
29
    /**
30
     * Build the message.
31
     *
32
     *
33
     * @throws \Exception
34
     */
35
    public function build(): static
36
    {
37
        return $this->from($this->siteEmail)->subject('Account expired')->view('emails.accountExpired')->with(['account' => $this->user->role->name, 'username' => $this->user->username, 'site' => $this->siteTitle]);
38
    }
39
}
40