Blame view

app/Notifications/Auth/Reset.php 1.16 KB
b7c7a5f6   Alexey Boroda   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  <?php
  
  namespace App\Notifications\Auth;
  
  use Illuminate\Notifications\Notification;
  use Illuminate\Notifications\Messages\MailMessage;
  
  class Reset extends Notification
  {
      /**
       * The password reset token.
       *
       * @var string
       */
      public $token;
  
      /**
       * Create a notification instance.
       *
       * @param  string  $token
       */
      public function __construct($token)
      {
          $this->token = $token;
      }
  
      /**
       * Get the notification's channels.
       *
       * @param  mixed  $notifiable
       * @return array|string
       */
      public function via($notifiable)
      {
          return ['mail'];
      }
  
      /**
       * Build the mail representation of the notification.
       *
       * @param  mixed  $notifiable
       * @return \Illuminate\Notifications\Messages\MailMessage
       */
      public function toMail($notifiable)
      {
          setting(['general.company_name' => config('app.name')]);
  
          return (new MailMessage)
              ->line(trans('auth.notification.message_1'))
              ->action(trans('auth.notification.button'), url('auth/reset', $this->token, true))
              ->line(trans('auth.notification.message_2'));
      }
  }