1 | <?php |
||
2 | |||
3 | namespace Fouladgar\MobileVerification\Notifications; |
||
4 | |||
5 | use Fouladgar\MobileVerification\Contracts\MustVerifyMobile; |
||
6 | use Fouladgar\MobileVerification\Notifications\Channels\VerificationChannel; |
||
7 | use Fouladgar\MobileVerification\Notifications\Messages\MobileVerificationMessage; |
||
8 | use Illuminate\Notifications\Notification; |
||
9 | |||
10 | class VerifyMobile extends Notification |
||
11 | { |
||
12 | /** |
||
13 | * The verification token. |
||
14 | * |
||
15 | * @var string |
||
16 | */ |
||
17 | public $token; |
||
18 | |||
19 | /** |
||
20 | * Create a notification instance. |
||
21 | * |
||
22 | * @param string $token |
||
23 | * |
||
24 | * @return void |
||
25 | */ |
||
26 | public function __construct(string $token) |
||
27 | { |
||
28 | $this->token = $token; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Get the notification's channels. |
||
33 | * |
||
34 | * @param mixed $notifiable |
||
35 | * |
||
36 | * @return array|string |
||
37 | */ |
||
38 | public function via($notifiable) |
||
0 ignored issues
–
show
|
|||
39 | { |
||
40 | return [VerificationChannel::class]; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Build the mobile representation of the notification. |
||
45 | * |
||
46 | * @param $notifiable |
||
47 | * |
||
48 | * @return MobileVerificationMessage |
||
49 | */ |
||
50 | public function toMobile(MustVerifyMobile $notifiable): MobileVerificationMessage |
||
51 | { |
||
52 | return (new MobileVerificationMessage())->to($notifiable->getMobileForVerification()) |
||
53 | ->token($this->token); |
||
54 | } |
||
55 | } |
||
56 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.