|
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\Support\Facades\Lang; |
|
19
|
|
|
use Illuminate\Notifications\Notification; |
|
20
|
|
|
use Illuminate\Notifications\Messages\MailMessage; |
|
21
|
|
|
|
|
22
|
|
|
class PasswordResetRequestNotification extends Notification |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* The password reset token. |
|
26
|
|
|
* |
|
27
|
|
|
* @var string |
|
28
|
|
|
*/ |
|
29
|
|
|
public $token; |
|
30
|
|
|
|
|
31
|
|
|
/** |
|
32
|
|
|
* The password reset token expiration. |
|
33
|
|
|
* |
|
34
|
|
|
* @var string |
|
35
|
|
|
*/ |
|
36
|
|
|
public $expiration; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Create a notification instance. |
|
40
|
|
|
* |
|
41
|
|
|
* @param array $token |
|
42
|
|
|
* @param string $expiration |
|
43
|
|
|
* |
|
44
|
|
|
* @return void |
|
|
|
|
|
|
45
|
|
|
*/ |
|
46
|
|
|
public function __construct(array $token, $expiration) |
|
47
|
|
|
{ |
|
48
|
|
|
$this->token = $token; |
|
|
|
|
|
|
49
|
|
|
$this->expiration = $expiration; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* Get the notification's channels. |
|
54
|
|
|
* |
|
55
|
|
|
* @param mixed $notifiable |
|
56
|
|
|
* |
|
57
|
|
|
* @return array|string |
|
58
|
|
|
*/ |
|
59
|
|
|
public function via($notifiable) |
|
|
|
|
|
|
60
|
|
|
{ |
|
61
|
|
|
return ['mail']; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Build the mail representation of the notification. |
|
66
|
|
|
* |
|
67
|
|
|
* @return \Illuminate\Notifications\Messages\MailMessage |
|
68
|
|
|
*/ |
|
69
|
|
|
public function toMail() |
|
70
|
|
|
{ |
|
71
|
|
|
return (new MailMessage) |
|
72
|
|
|
->subject(Lang::get('rinvex.fort::email.reset.request.subject')) |
|
73
|
|
|
->line(Lang::get('rinvex.fort::email.reset.request.intro')) |
|
74
|
|
|
->action(Lang::get('rinvex.fort::email.reset.request.action'), route('rinvex.fort.password.reset').'?token='.$this->token['token'].'&email='.$this->token['email']) |
|
|
|
|
|
|
75
|
|
|
->line(Lang::get('rinvex.fort::email.reset.request.outro', [ |
|
76
|
|
|
'created_at' => $this->token['created_at'], |
|
77
|
|
|
'ip' => $this->token['ip'], |
|
78
|
|
|
'agent' => $this->token['agent'], |
|
79
|
|
|
])); |
|
80
|
|
|
} |
|
81
|
|
|
} |
|
82
|
|
|
|
Adding a
@returnannotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.