Passed
Push — develop ( 330c0c...a751d7 )
by Septianata
12:33
created

User::sendEmailVerificationNotification()   A

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 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
ccs 2
cts 2
cp 1
crap 1
1
<?php
2
3
namespace App\Models;
4
5
use App\Enum\Gender;
6
use App\Infrastructure\Foundation\Auth\User as Authenticatable;
7
use App\Notifications\ResetPasswordQueued;
8
use App\Notifications\VerifyEmailQueued;
9
use Illuminate\Contracts\Auth\MustVerifyEmail;
10
use Illuminate\Database\Eloquent\Factories\HasFactory;
11
use Illuminate\Notifications\Notifiable;
12
use Propaganistas\LaravelPhone\Casts\E164PhoneNumberCast;
13
14
class User extends Authenticatable implements MustVerifyEmail
15
{
16
    use HasFactory, Notifiable,
0 ignored issues
show
introduced by
The trait App\Models\Concerns\User\Relation requires some properties which are not provided by App\Models\User: $name, $map, $permissions, $guard_name
Loading history...
17
        Concerns\User\Attribute,
18
        Concerns\User\Relation;
19
20
    /**
21
     * The attributes that are mass assignable.
22
     *
23
     * @var array
24
     */
25
    protected $fillable = [
26
        'username',
27
        'fullname',
28
        'gender',
29
        'email',
30
        'phone_country',
31
        'phone',
32
        'password',
33
    ];
34
35
    /**
36
     * The attributes that should be hidden for arrays.
37
     *
38
     * @var array
39
     */
40
    protected $hidden = [
41
        'password',
42
        'remember_token',
43
    ];
44
45
    /**
46
     * The attributes that should be cast to native types.
47
     *
48
     * @var array
49
     */
50
    protected $casts = [
51
        'gender' => Gender::class,
52
        'phone' => E164PhoneNumberCast::class,
53
        'email_verified_at' => 'datetime',
54
    ];
55
56
    /**
57
     * {@inheritDoc}
58
     */
59 1
    public function sendEmailVerificationNotification()
60
    {
61 1
        $this->notify(new VerifyEmailQueued);
62 1
    }
63
64
    /**
65
     * {@inheritDoc}
66
     */
67 3
    public function sendPasswordResetNotification($token)
68
    {
69 3
        $this->notify(new ResetPasswordQueued($token));
70 3
    }
71
}
72