Completed
Pull Request — master (#165)
by Cristian
04:36 queued 02:11
created

BackpackUser::sendPasswordResetNotification()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 2
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
3
namespace Backpack\Base\app\Models;
4
5
use App\User;
6
use Backpack\Base\app\Notifications\ResetPasswordNotification as ResetPasswordNotification;
7
8
class BackpackUser extends User
9
{
10
    protected $table = 'users';
11
12
    /**
13
     * Send the password reset notification.
14
     *
15
     * @param string $token
16
     *
17
     * @return void
18
     */
19
    public function sendPasswordResetNotification($token)
20
    {
21
        $this->notify(new ResetPasswordNotification($token));
22
    }
23
24
    /**
25
     * Build the mail representation of the notification.
26
     *
27
     * @return \Illuminate\Notifications\Messages\MailMessage
28
     */
29 View Code Duplication
    public function toMail($notifiable)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
30
    {
31
        return (new MailMessage())
32
            ->line([
33
                'You are receiving this email because we received a password reset request for your account.',
34
                'Click the button below to reset your password:',
35
            ])
36
            ->action('Reset Password', url(config('backpack.base.route_prefix').'/password/reset', $this->token))
37
            ->line('If you did not request a password reset, no further action is required.');
38
    }
39
}
40