Completed
Pull Request — master (#9)
by ARCANEDEV
04:02
created

ResetPassword::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace Arcanesoft\Auth\Notifications\Users;
2
3
use Illuminate\Notifications\Notification;
4
use Illuminate\Notifications\Messages\MailMessage;
5
6
/**
7
 * Class     ResetPassword
8
 *
9
 * @package  Arcanesoft\Auth\Notifications\Users
10
 * @author   ARCANEDEV <[email protected]>
11
 */
12
class ResetPassword extends Notification
13
{
14
    /* ------------------------------------------------------------------------------------------------
15
     |  Properties
16
     | ------------------------------------------------------------------------------------------------
17
     */
18
    /**
19
     * The password reset token.
20
     *
21
     * @var string
22
     */
23
    public $token;
24
25
    /* ------------------------------------------------------------------------------------------------
26
     |  Constructors
27
     | ------------------------------------------------------------------------------------------------
28
     */
29
    /**
30
     * Create a notification instance.
31
     *
32
     * @param  string  $token
33
     */
34
    public function __construct($token)
35
    {
36
        $this->token = $token;
37
    }
38
39
    /* ------------------------------------------------------------------------------------------------
40
     |  Main Functions
41
     | ------------------------------------------------------------------------------------------------
42
     */
43
    /**
44
     * Get the notification's channels.
45
     *
46
     * @param  mixed  $notifiable
47
     *
48
     * @return array|string
49
     */
50
    public function via($notifiable)
51
    {
52
        return ['mail'];
53
    }
54
55
    /**
56
     * Build the mail representation of the notification.
57
     *
58
     * @return \Illuminate\Notifications\Messages\MailMessage
59
     */
60
    public function toMail()
61
    {
62
        return (new MailMessage)
63
            ->line(trans('auth::password.mail.line-1'))
64
            ->action(trans('auth::password.mail.action'), route('auth::password.token', [$this->token]))
65
            ->line(trans('auth::password.mail.line-2'));
66
    }
67
}
68