Passed
Push — dependabot/npm_and_yarn/string... ( b56eb5...bc569b )
by
unknown
45:46 queued 33s
created

ResetAdminPassword   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Test Coverage

Coverage 41.67%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 47
ccs 5
cts 12
cp 0.4167
rs 10
c 0
b 0
f 0
wmc 4
1
<?php
2
3
namespace Thinktomorrow\Chief\App\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Notifications\Notification;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Queue\SerializesModels;
10
11
class ResetAdminPassword extends Notification implements ShouldQueue
12
{
13
    use Queueable, SerializesModels;
14
15
    public $token;
16
17
    public function __construct($token)
18
    {
19
        $this->token = $token;
20
    }
21
22
    /**
23
     * Get the notification's delivery channels.
24
     *
25
     * @param  mixed  $notifiable
26
     * @return array
27
     */
28
    public function via($notifiable)
29
    {
30
        return ['mail'];
31
    }
32
33
    /**
34
     * Get the mail representation of the notification.
35
     *
36
     * @param  mixed  $notifiable
37
     * @return \Illuminate\Notifications\Messages\MailMessage
38
     */
39
    public function toMail($notifiable)
40
    {
41
        return (new MailMessage())
42
            ->subject('Herstel jouw wachtwoord.')
43
            ->from(chiefSetting('contact.email'), chiefSetting('contact.name'))
44
            ->view('chief::back.mails.password-reset', [
45
                'reset_url' => route('chief.back.password.reset', $this->token),
46
            ]);
47
    }
48
49
    /**
50
     * Get the array representation of the notification.
51
     *
52
     * @param  mixed  $notifiable
53
     * @return array
54
     */
55
    public function toArray($notifiable)
56
    {
57
        return [
58
            //
59
        ];
60
    }
61
}
62