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

User   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 21
c 1
b 0
f 0
dl 0
loc 56
rs 10
ccs 5
cts 5
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sendEmailVerificationNotification() 0 3 1
A sendPasswordResetNotification() 0 3 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