Completed
Pull Request — master (#165)
by Cristian
02:14
created

BackpackUser::sendPasswordResetNotification()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
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
    * @return void
17
    */
18
    public function sendPasswordResetNotification($token)
19
    {
20
      $this->notify(new ResetPasswordNotification($token));
21
    }
22
23
    /**
24
     * Build the mail representation of the notification.
25
     *
26
     * @return \Illuminate\Notifications\Messages\MailMessage
27
     */
28 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...
29
    {
30
        return (new MailMessage())
31
            ->line([
32
                'You are receiving this email because we received a password reset request for your account.',
33
                'Click the button below to reset your password:',
34
            ])
35
            ->action('Reset Password', url(config('backpack.base.route_prefix').'/password/reset', $this->token))
36
            ->line('If you did not request a password reset, no further action is required.');
37
    }
38
}
39