Issues (364)

app/Notifications/SendActivationEmail.php (3 issues)

1
<?php
2
3
namespace App\Notifications;
4
5
use Illuminate\Bus\Queueable;
6
use Illuminate\Contracts\Queue\ShouldQueue;
7
use Illuminate\Notifications\Messages\MailMessage;
8
use Illuminate\Notifications\Notification;
9
10
class SendActivationEmail extends Notification implements ShouldQueue
11
{
12
    use Queueable;
13
14
    /**
15
     * Create a new notification instance.
16
     *
17
     * SendActivationEmail constructor.
18
     *
19
     * @param  $token
20
     */
21
    public function __construct(protected $token)
22
    {
23
        // $this->onQueue('social');
24
    }
25
26
    /**
27
     * Get the notification's delivery channels.
28
     *
29
     * @return array
30
     */
31
    public function via(mixed $notifiable)
0 ignored issues
show
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

31
    public function via(/** @scrutinizer ignore-unused */ mixed $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...
32
    {
33
        return ['mail'];
34
    }
35
36
    /**
37
     * Get the mail representation of the notification.
38
     *
39
     * @return \Illuminate\Notifications\Messages\MailMessage
40
     */
41
    public function toMail(mixed $notifiable)
0 ignored issues
show
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

41
    public function toMail(/** @scrutinizer ignore-unused */ mixed $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...
42
    {
43
        $baseUrl = env('APP_URL');
44
        $url = $baseUrl.'/verify?token='.$this->token;
45
        $message = new MailMessage();
46
        $message->subject(trans('emails.activationSubject'))
47
            ->greeting(trans('emails.activationGreeting'))
48
            ->line(trans('emails.activationMessage'))
49
            ->action(trans('emails.activationButton'), $url)
50
            ->line($this->token)
51
            ->line(trans('emails.activationThanks'));
52
53
        return $message;
54
    }
55
56
    /**
57
     * Get the array representation of the notification.
58
     *
59
     * @return array
60
     */
61
    public function toArray(mixed $notifiable)
0 ignored issues
show
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

61
    public function toArray(/** @scrutinizer ignore-unused */ mixed $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...
62
    {
63
        return [
64
65
        ];
66
    }
67
}
68