Passed
Push — master ( 1ffd02...b93f0b )
by Bertrand
06:21
created

VerifyEmail   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 14 1
A __construct() 0 3 1
1
<?php
2
3
4
namespace App\Mail\Auth;
5
6
7
use Illuminate\Bus\Queueable;
8
use Illuminate\Mail\Mailable;
9
use Illuminate\Queue\SerializesModels;
10
use Illuminate\Support\Carbon;
11
use Illuminate\Support\Facades\Config;
12
use Illuminate\Support\Facades\URL;
13
14
class VerifyEmail extends Mailable
15
{
16
    use Queueable, SerializesModels;
0 ignored issues
show
introduced by
The trait Illuminate\Queue\SerializesModels requires some properties which are not provided by App\Mail\Auth\VerifyEmail: $id, $relations, $class, $keyBy
Loading history...
17
18
    private $user;
19
20
    public function __construct($user)
21
    {
22
        $this->user = $user;
23
    }
24
25
    public function build()
26
    {
27
        $url = URL::temporarySignedRoute(
28
            'verification.verify',
29
            Carbon::now()->addMinutes(config('auth.verification.expire')),
30
            [
31
                'id' => $this->user->getKey(),
32
                'hash' => sha1($this->user->getEmailForVerification()),
33
            ]
34
        );
35
36
        return $this->view('mails.auth.verify-email', [
37
            'url' => $url,
38
        ])->subject('Tripleperformance : Vérifiez votre email');
39
    }
40
}
41