PasswordResetRequest.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. namespace App\Notifications;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Notifications\Notification;
  5. use Illuminate\Contracts\Queue\ShouldQueue;
  6. use Illuminate\Notifications\Messages\MailMessage;
  7. class PasswordResetRequest extends Notification
  8. {
  9. use Queueable;
  10. /**
  11. * Create a new notification instance.
  12. *
  13. * @return void
  14. */
  15. protected $token;
  16. public function __construct($token)
  17. {
  18. $this->token = $token;
  19. }
  20. /**
  21. * Get the notification's delivery channels.
  22. *
  23. * @param mixed $notifiable
  24. * @return array
  25. */
  26. public function via($notifiable)
  27. {
  28. return ['mail'];
  29. }
  30. /**
  31. * Get the mail representation of the notification.
  32. *
  33. * @param mixed $notifiable
  34. * @return \Illuminate\Notifications\Messages\MailMessage
  35. */
  36. public function toMail($notifiable)
  37. {
  38. $url = env('APP_URL') . '/password/reset/' . $this->token;
  39. return (new MailMessage)
  40. ->line('You are receiving this email because we received a password reset request for your account.')
  41. ->action('Reset Password', $url)
  42. ->line('If you did not request a password reset, no further action is required.');
  43. }
  44. /**
  45. * Get the array representation of the notification.
  46. *
  47. * @param mixed $notifiable
  48. * @return array
  49. */
  50. public function toArray($notifiable)
  51. {
  52. return [
  53. //
  54. ];
  55. }
  56. }