Admin::sendPasswordResetNotification()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Models;
4
5
use App\Notifications\Admin\Auth\ResetPassword;
6
use App\Notifications\Admin\Auth\VerifyEmail;
7
use Illuminate\Contracts\Auth\MustVerifyEmail;
8
use Illuminate\Database\Eloquent\Factories\HasFactory;
9
use Illuminate\Foundation\Auth\User as Authenticatable;
10
use Illuminate\Notifications\Notifiable;
11
use Laravel\Sanctum\HasApiTokens;
12
13
class Admin extends Authenticatable implements MustVerifyEmail
14
{
15
    use HasApiTokens, HasFactory, Notifiable;
0 ignored issues
show
Bug introduced by
The trait Illuminate\Notifications\Notifiable requires the property $email which is not provided by App\Models\Admin.
Loading history...
16
17
    /**
18
     * The attributes that are mass assignable.
19
     *
20
     * @var array<int, string>
21
     */
22
    protected $fillable = [
23
        'name',
24
        'email',
25
        'password',
26
    ];
27
28
    /**
29
     * The attributes that should be hidden for serialization.
30
     *
31
     * @var array<int, string>
32
     */
33
    protected $hidden = [
34
        'password',
35
        'remember_token',
36
    ];
37
38
    /**
39
     * The attributes that should be cast.
40
     *
41
     * @var array<string, string>
42
     */
43
    protected $casts = [
44
        'email_verified_at' => 'datetime',
45
    ];
46
47
    /**
48
     * Send the password reset notification.
49
     *
50
     * @param  string  $token
51
     */
52 3
    public function sendPasswordResetNotification($token)
53
    {
54 3
        $this->notify(new ResetPassword($token));
55
    }
56
57
    /**
58
     * Send the email verification notification.
59
     */
60 2
    public function sendEmailVerificationNotification()
61
    {
62 2
        $this->notify(new VerifyEmail());
63
    }
64
}
65