Passed
Push — master ( 3e77af...7c612c )
by Brian
02:49
created

Admin::sendPasswordResetNotification()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Modules\Admins\Models;
4
5
use App\Modules\Admins\Database\Factories\AdminFactory;
6
use App\Modules\Admins\Notifications\Auth\ResetPassword;
7
use App\Modules\Admins\Notifications\Auth\VerifyEmail;
8
use Illuminate\Contracts\Auth\MustVerifyEmail;
9
use Illuminate\Database\Eloquent\Factories\HasFactory;
10
use Illuminate\Foundation\Auth\User as Authenticatable;
11
use Illuminate\Notifications\Notifiable;
12
use Laravel\Sanctum\HasApiTokens;
0 ignored issues
show
Bug introduced by
The type Laravel\Sanctum\HasApiTokens was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
14
class Admin extends Authenticatable implements MustVerifyEmail
15
{
16
    use HasApiTokens, HasFactory, Notifiable;
17
18
    /**
19
     * The attributes that are mass assignable.
20
     *
21
     * @var array<int, string>
22
     */
23
    protected $fillable = [
24
        'name',
25
        'email',
26
        'password',
27
    ];
28
29
    /**
30
     * The attributes that should be hidden for serialization.
31
     *
32
     * @var array<int, string>
33
     */
34
    protected $hidden = [
35
        'password',
36
        'remember_token',
37
    ];
38
39
    /**
40
     * The attributes that should be cast.
41
     *
42
     * @var array<string, string>
43
     */
44
    protected $casts = [
45
        'email_verified_at' => 'datetime',
46
    ];
47
48
    /**
49
     * Create a new factory instance for the model.
50
     *
51
     * @return \Illuminate\Database\Eloquent\Factories\Factory<static>
52
     */
53
    protected static function newFactory()
54
    {
55
        return AdminFactory::new();
56
    }
57
58
    /**
59
     * Send the password reset notification.
60
     *
61
     * @param  string  $token
62
     */
63
    public function sendPasswordResetNotification($token)
64
    {
65
        $this->notify(new ResetPassword($token));
66
    }
67
68
    /**
69
     * Send the email verification notification.
70
     */
71
    public function sendEmailVerificationNotification()
72
    {
73
        $this->notify(new VerifyEmail());
74
    }
75
}
76