Passed
Push — dev5 ( 60964f...52deb7 )
by Ron
07:11
created

User::getFullNameAttribute()   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
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App;
4
5
use Illuminate\Notifications\Notifiable;
6
use Illuminate\Foundation\Auth\User as Authenticatable;
7
8
class User extends Authenticatable
9
{
10
    use Notifiable;
1 ignored issue
show
Bug introduced by
The trait Illuminate\Notifications\Notifiable requires the property $email which is not provided by App\User.
Loading history...
11
12
    /**
13
     * The attributes that are mass assignable.
14
     *
15
     * @var array
16
     */
17
    protected $fillable = [
18
        'username', 'first_name', 'last_name', 'email', 'password', 'password_expires', 'active', 'is_installer'
19
    ];
20
21
    /**
22
     * The attributes that should be hidden for arrays.
23
     *
24
     * @var array
25
     */
26
    protected $hidden = [
27
        'password', 'remember_token', 'is_installer', 'active', 'created_at', 'password_expires', 'updated_at', 'user_id', 'username'
28
    ];
29
30
    //  Database primary key
31
    protected $primaryKey = 'user_id';
32
33
    protected $appends = [ 'full_name' ];
34
35 2
    public function getFullNameAttribute()
36
    {
37 2
        return "{$this->first_name} {$this->last_name}";
38
    }
39
40
    // public function UserLogins()
41
    // {
42
    //     return $this->hasMany('App\UserLogins', 'user_id', 'user_id');
43
    // }
44
45 2
    public function UserPermissions()
46
    {
47 2
        return $this->hasOne('App\UserPermissions', 'user_id', 'user_id');
48
    }
49
50
    // public function fileLinks()
51
    // {
52
    //     return $this->hasMany('App\FileLinks', 'user_id', 'user_id');
53
    // }
54
55
    // public function fileLinkFiles()
56
    // {
57
    //     return $this->belongsTo('App\FileLinkFiles', 'user_id', 'user_id');
58
    // }
59
60
    // public function customerFavs()
61
    // {
62
    //     return $this->belongsTo('App\CustomerFavs', 'user_id', 'user_id');
63
    // }
64
65
    // public function customerNotes()
66
    // {
67
    //     return $this->belongsTo('App\CustomerNotes', 'user_id', 'user_id');
68
    // }
69
70
    // public function techTips()
71
    // {
72
    //     return $this->belongsTo('App\TechTips', 'user_id', 'user_id');
73
    // }
74
75
    // public function techTipComments()
76
    // {
77
    //     return $this->belongsTo('App\TechTipComments', 'user_id', 'user_id');
78
    // }
79
}
80