source: app/Notifications/VerifyNewEmail.php@ 0924b6c

Last change on this file since 0924b6c was 0924b6c, checked in by Özkan İliyaz <iliyaz_96@…>, 4 years ago

initial commit

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[0924b6c]1<?php
2
3namespace App\Notifications;
4
5use App\Models\User;
6use Illuminate\Bus\Queueable;
7use Illuminate\Notifications\Notification;
8use Illuminate\Notifications\Messages\MailMessage;
9
10class 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.