InvitationLinkToOrganization   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A build() 0 7 1
1
<?php
2
3
namespace App\Mail;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Mail\Mailable;
8
use Illuminate\Queue\SerializesModels;
9
10
class InvitationLinkToOrganization 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\InvitationLinkToOrganization: $id, $relations, $class, $keyBy
Loading history...
13
14
    private $hash;
15
    private $email;
16
    private $firstname;
17
    private $lastname;
18
    private $organization;
19
20
    public function __construct(string $hash, string $email, string $organization, string $firstname = null, string $lastname = null)
21
    {
22
        $this->hash = $hash;
23
        $this->email = $email;
24
        $this->firstname = $firstname;
25
        $this->lastname = $lastname;
26
        $this->organization = $organization;
27
    }
28
29
    public function build()
30
    {
31
        $link = route('organization.invite.show').'?&token='.$this->hash;
32
        return $this->view('mails.invitationLinkToOrganization', [
33
            'link' => $link,
34
            'firstname' => $this->firstname,
35
            'organization' => $this->organization
36
        ]);
37
    }
38
}
39