Completed
Push — dev5 ( 8e8b96...5f8a7c )
by Ron
09:14
created

User::systemFiles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
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
    public function getFullNameAttribute()
36
    {
37
        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
    public function systemFiles()
46
    {
47
        return $this->hasMany('App\SystemFiles', 'user_id', 'user_id');
48
    }
49
50
    public function customerFavs()
51
    {
52
        return $this->belongsTo('App\CustomerFavs', 'user_id', 'user_id');
53
    }
54
55
    public function customerNotes()
56
    {
57
        return $this->belongsTo('App\CustomerNotes', 'user_id', 'user_id');
58
    }
59
60
    public function techTips()
61
    {
62
        return $this->belongsTo('App\TechTips', 'user_id', 'user_id');
63
    }
64
65
    public function techTipComments()
66
    {
67
        return $this->belongsTo('App\TechTipComments', 'user_id', 'user_id');
68
    }
69
70
    public function fileLinks()
71
    {
72
        return $this->hasMany('App\FileLinks', 'user_id', 'user_id');
73
    }
74
}
75