source:
app/Notifications/VerifyNewEmail.php@
83da0d2
Last change on this file since 83da0d2 was 194a359, checked in by , 3 years ago | |
---|---|
|
|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[194a359] | 1 | <?php |
2 | ||
3 | namespace App\Notifications; | |
4 | ||
5 | use App\Models\User; | |
6 | use Illuminate\Bus\Queueable; | |
7 | use Illuminate\Notifications\Notification; | |
8 | use Illuminate\Notifications\Messages\MailMessage; | |
9 | ||
10 | class VerifyNewEmail extends Notification | |
11 | { | |
12 | use Queueable; | |
13 | ||
14 | private $user; | |
15 | ||
16 | /** | |
17 | * Create a new notification instance. | |
18 | * | |
19 | * @return void | |
20 | */ | |
21 | public function __construct(User $user) | |
22 | { | |
23 | $this->user = $user; | |
24 | } | |
25 | ||
26 | /** | |
27 | * Get the notification's delivery channels. | |
28 | * | |
29 | * @param mixed $notifiable | |
30 | * @return array | |
31 | */ | |
32 | public function via($notifiable) | |
33 | { | |
34 | return ['mail']; | |
35 | } | |
36 | ||
37 | /** | |
38 | * Get the mail representation of the notification. | |
39 | * | |
40 | * @param mixed $notifiable | |
41 | * @return \Illuminate\Notifications\Messages\MailMessage | |
42 | */ | |
43 | public function toMail($notifiable) | |
44 | { | |
45 | return (new MailMessage) | |
46 | ->greeting("Hello " . $this->user->name) | |
47 | ->line("To verify your new email click the button.") | |
48 | ->line("Your security code is: " . $this->user->security_code) | |
49 | ->action("Verify", url("/auth/verify/" . $this->user->id . "/" . $this->user->verify_token)); | |
50 | } | |
51 | ||
52 | /** | |
53 | * Get the array representation of the notification. | |
54 | * | |
55 | * @param mixed $notifiable | |
56 | * @return array | |
57 | */ | |
58 | public function toArray($notifiable) | |
59 | { | |
60 | return [ | |
61 | // | |
62 | ]; | |
63 | } | |
64 | } |
Note:
See TracBrowser
for help on using the repository browser.