1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace FaithGen\SDK\Notifications\Ministry; |
4
|
|
|
|
5
|
|
|
use FaithGen\SDK\Models\Ministry; |
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 ForgotPassword extends Notification implements ShouldQueue |
12
|
|
|
{ |
13
|
|
|
use Queueable; |
14
|
|
|
/** |
15
|
|
|
* @var Ministry |
16
|
|
|
*/ |
17
|
|
|
private $ministry; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Create a new notification instance. |
21
|
|
|
* |
22
|
|
|
* @param Ministry $ministry |
23
|
|
|
*/ |
24
|
|
|
public function __construct(Ministry $ministry) |
25
|
|
|
{ |
26
|
|
|
$this->ministry = $ministry; |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Get the notification's delivery channels. |
31
|
|
|
* |
32
|
|
|
* @param mixed $notifiable |
33
|
|
|
* @return array |
34
|
|
|
*/ |
35
|
|
|
public function via($notifiable) |
|
|
|
|
36
|
|
|
{ |
37
|
|
|
return ['mail']; |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Get the mail representation of the notification. |
42
|
|
|
* |
43
|
|
|
* @param mixed $notifiable |
44
|
|
|
* @return \Illuminate\Notifications\Messages\MailMessage |
45
|
|
|
*/ |
46
|
|
|
public function toMail($notifiable) |
|
|
|
|
47
|
|
|
{ |
48
|
|
|
return (new MailMessage) |
49
|
|
|
->greeting('Hello '.$this->ministry->name) |
50
|
|
|
->line('You have requested for a password change, Please click the link below to update it!') |
51
|
|
|
->action('Reset Password', url('/')) |
52
|
|
|
->from('[email protected]', 'Faith Gen') |
53
|
|
|
->subject('Forgot password!') |
54
|
|
|
->line('Thank you for using our application!'); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* Get the array representation of the notification. |
59
|
|
|
* |
60
|
|
|
* @param mixed $notifiable |
61
|
|
|
* @return array |
62
|
|
|
*/ |
63
|
|
|
public function toArray($notifiable) |
|
|
|
|
64
|
|
|
{ |
65
|
|
|
return [ |
66
|
|
|
// |
67
|
|
|
]; |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.