develop
Last change
on this file since 9141ace was 7304c7f, checked in by beratkjufliju <kufliju@…>, 3 years ago |
added user authentication, create & forgot password methods and blades
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[7304c7f] | 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 ForgotPassword 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 create or change your password click on the button")
|
---|
| 48 | ->line("Your security code is: " . $this->user->security_code )
|
---|
| 49 | ->action("Create Password", url("/auth/create-password/" . $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.