RegistrationConfirmation::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace App\Mail;
4
5
use App\Judite\Models\User;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Mail\Mailable;
8
use Illuminate\Queue\SerializesModels;
9
10
class RegistrationConfirmation extends Mailable
11
{
12
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\RegistrationConfirmation: $id, $class
Loading history...
13
14
    /**
15
     * The user to be confirmed.
16
     *
17
     * @var string
18
     */
19
    public $user;
20
21
    /**
22
     * Create a new message instance.
23
     *
24
     * @param \App\Judite\Models\User $user
25
     */
26
    public function __construct(User $user)
27
    {
28
        $this->user = $user;
29
    }
30
31
    /**
32
     * Build the message.
33
     *
34
     * @return $this
35
     */
36
    public function build()
37
    {
38
        $name = $this->user->name;
0 ignored issues
show
Bug introduced by
The property name does not exist on string.
Loading history...
39
        $token = $this->user->verification_token;
0 ignored issues
show
Bug introduced by
The property verification_token does not exist on string.
Loading history...
40
        $confirmationUrl = route('register.confirm', compact('token'));
41
42
        return $this->markdown('emails.registrations.confirm', compact('name', 'confirmationUrl'));
43
    }
44
}
45