User::getUserIndentifier()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace CodexShaper\OAuth2\Server\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class User extends Model
8
{
9
    /**
10
     * The attributes that are mass assignable.
11
     *
12
     * @var array
13
     */
14
    protected $fillable = [
15
        'name', 'email', 'password',
16
    ];
17
18
    /**
19
     * The attributes that should be hidden for arrays.
20
     *
21
     * @var array
22
     */
23
    protected $hidden = [
24
        'password', 'remember_token',
25
    ];
26
27
    /**
28
     * The attributes that should be cast to native types.
29
     *
30
     * @var array
31
     */
32
    protected $casts = [
33
        'email_verified_at' => 'datetime',
34
    ];
35
36
    /**
37
     * User identifier field.
38
     *
39
     * @var array
40
     */
41
    protected $username = 'email';
42
43
    /**
44
     * Get user identifier field.
45
     *
46
     * @return string
47
     */
48
    public function getUserIndentifier()
49
    {
50
        return $this->username;
51
    }
52
}
53