1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* NOTICE OF LICENSE |
5
|
|
|
* |
6
|
|
|
* Part of the Rinvex Fort Package. |
7
|
|
|
* |
8
|
|
|
* This source file is subject to The MIT License (MIT) |
9
|
|
|
* that is bundled with this package in the LICENSE file. |
10
|
|
|
* |
11
|
|
|
* Package: Rinvex Fort Package |
12
|
|
|
* License: The MIT License (MIT) |
13
|
|
|
* Link: https://rinvex.com |
14
|
|
|
*/ |
15
|
|
|
|
16
|
|
|
namespace Rinvex\Fort\Notifications; |
17
|
|
|
|
18
|
|
|
use Illuminate\Notifications\Notification; |
19
|
|
|
use Illuminate\Notifications\Messages\MailMessage; |
20
|
|
|
|
21
|
|
|
class PasswordResetNotification extends Notification |
22
|
|
|
{ |
23
|
|
|
/** |
24
|
|
|
* The password reset token. |
25
|
|
|
* |
26
|
|
|
* @var string |
27
|
|
|
*/ |
28
|
|
|
public $token; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* The password reset token expiration. |
32
|
|
|
* |
33
|
|
|
* @var string |
34
|
|
|
*/ |
35
|
|
|
public $expiration; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Create a notification instance. |
39
|
|
|
* |
40
|
|
|
* @param array $token |
41
|
|
|
* @param string $expiration |
42
|
|
|
*/ |
43
|
|
|
public function __construct(array $token, $expiration) |
44
|
|
|
{ |
45
|
|
|
$this->token = $token; |
|
|
|
|
46
|
|
|
$this->expiration = $expiration; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Get the notification's channels. |
51
|
|
|
* |
52
|
|
|
* @param mixed $notifiable |
53
|
|
|
* |
54
|
|
|
* @return array|string |
55
|
|
|
*/ |
56
|
|
|
public function via($notifiable) |
|
|
|
|
57
|
|
|
{ |
58
|
|
|
return ['mail']; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Build the mail representation of the notification. |
63
|
|
|
* |
64
|
|
|
* @return \Illuminate\Notifications\Messages\MailMessage |
65
|
|
|
*/ |
66
|
|
|
public function toMail() |
67
|
|
|
{ |
68
|
|
|
return (new MailMessage()) |
69
|
|
|
->subject(trans('rinvex/fort::frontend/emails.passwordreset.request.subject')) |
|
|
|
|
70
|
|
|
->line(trans('rinvex/fort::frontend/emails.passwordreset.request.intro', ['expire' => $this->expiration])) |
|
|
|
|
71
|
|
|
->action(trans('rinvex/fort::frontend/emails.passwordreset.request.action'), route('rinvex.fort.frontend.passwordreset.reset').'?token='.$this->token['token'].'&email='.$this->token['email']) |
|
|
|
|
72
|
|
|
->line(trans('rinvex/fort::frontend/emails.passwordreset.request.outro', [ |
|
|
|
|
73
|
|
|
'ip' => $this->token['ip'], |
74
|
|
|
'agent' => $this->token['agent'], |
75
|
|
|
'created_at' => $this->token['created_at'], |
76
|
|
|
])); |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..