Passed
Push — dev5 ( 3685b3...3ab1f5 )
by Ron
07:25
created

User::UserSettings()   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 = ['username', 'first_name', 'last_name', 'email', 'password', 'password_expires', 'active', 'is_installer'];
18
    protected $hidden = ['password', 'remember_token', 'is_installer', 'active', 'created_at', 'password_expires', 'updated_at', 'user_id', 'username'];
19
    //  Database primary key
20
    protected $primaryKey = 'user_id';
21
22
    protected $appends = [ 'full_name' ];
23
24 6
    public function getFullNameAttribute()
25
    {
26 6
        return "{$this->first_name} {$this->last_name}";
27
    }
28
29
    // public function UserLogins()
30
    // {
31
    //     return $this->hasMany('App\UserLogins', 'user_id', 'user_id');
32
    // }
33
34 2
    public function UserPermissions()
35
    {
36 2
        return $this->hasOne('App\UserPermissions', 'user_id', 'user_id');
37
    }
38
39 4
    public function UserSettings()
40
    {
41 4
        return $this->hasOne('App\UserSettings', 'user_id', 'user_id');
42
    }
43
44
    // public function fileLinks()
45
    // {
46
    //     return $this->hasMany('App\FileLinks', 'user_id', 'user_id');
47
    // }
48
49
    // public function fileLinkFiles()
50
    // {
51
    //     return $this->belongsTo('App\FileLinkFiles', 'user_id', 'user_id');
52
    // }
53
54
    // public function customerFavs()
55
    // {
56
    //     return $this->belongsTo('App\CustomerFavs', 'user_id', 'user_id');
57
    // }
58
59
    // public function customerNotes()
60
    // {
61
    //     return $this->belongsTo('App\CustomerNotes', 'user_id', 'user_id');
62
    // }
63
64
    // public function techTips()
65
    // {
66
    //     return $this->belongsTo('App\TechTips', 'user_id', 'user_id');
67
    // }
68
69
    // public function techTipComments()
70
    // {
71
    //     return $this->belongsTo('App\TechTipComments', 'user_id', 'user_id');
72
    // }
73
}
74