Test Setup Failed
Push — dev6 ( 81193f...01d104 )
by Ron
22:34
created

SendWelcomeEmail::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Notifications;
4
5
use App\Models\User;
6
use Illuminate\Bus\Queueable;
7
use Illuminate\Contracts\Queue\ShouldQueue;
8
use Illuminate\Notifications\Messages\MailMessage;
9
use Illuminate\Notifications\Notification;
10
11
class SendWelcomeEmail extends Notification
12
{
13
    use Queueable;
14
15
    protected $user;
16
    protected $token;
17
18
    /**
19
     * Create a new notification instance.
20
     */
21
    public function __construct(User $user, $token)
22
    {
23
        $this->user  = $user;
24
        $this->token = $token;
25
    }
26
27
    /**
28
     * Get the notification's delivery channels.
29
     */
30
    public function via($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

30
    public function via(/** @scrutinizer ignore-unused */ $notifiable)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
    {
32
        return ['mail'];
33
    }
34
35
    /**
36
     *  Send an email to the new user with instructions to finish setting up their account
37
     */
38
    public function toMail($notifiable)
0 ignored issues
show
Unused Code introduced by
The parameter $notifiable is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
    public function toMail(/** @scrutinizer ignore-unused */ $notifiable)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
    {
40
        return (new MailMessage)
41
                    ->greeting('Hello '.$this->user->full_name)
42
                    ->line('A new '.config('app.name').' account has been created for you.')
43
                    ->line('Your new username is:  **'.$this->user->username.'**')
44
                    ->line('You can click the link below to finish setting up your account.')
45
                    ->action('Setup Account', url(route('initialize', $this->token)));
46
    }
47
48
    /**
49
     * Get the array representation of the notification.
50
     */
51
    // public function toArray($notifiable)
52
    // {
53
    //     return [
54
    //         //
55
    //     ];
56
    // }
57
}
58