Passed
Push — master ( e065bd...c15bec )
by Iman
04:29
created

CbUser::myPhoto()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace crocodicstudio\crudbooster\CBCoreModule;
4
5
use Illuminate\Foundation\Auth\User as Authenticatable;
6
use Illuminate\Notifications\Notifiable;
7
8
class CbUser extends Authenticatable
9
{
10
    use Notifiable;
0 ignored issues
show
introduced by
The trait Illuminate\Notifications\Notifiable requires some properties which are not provided by crocodicstudio\crudbooster\CBCoreModule\CbUser: $email, $phone_number
Loading history...
11
12
    protected $table = 'cms_users';
13
14
    /**
15
     * The attributes that are mass assignable.
16
     *
17
     * @var array
18
     */
19
    protected $fillable = [
20
        'name',
21
        'email',
22
        'password',
23
    ];
24
25
    /**
26
     * The attributes that should be hidden for arrays.
27
     *
28
     * @var array
29
     */
30
    protected $hidden = [
31
        'password',
32
        'remember_token',
33
    ];
34
35
    public function role()
36
    {
37
        return \DB::table('cms_privileges')->where('id', $this->id_cms_privileges)->first();
38
    }
39
40
    public function myPhoto() : string
41
    {
42
        $photo =  $this->photo ?: 'vendor/crudbooster/avatar.jpg';
43
        return asset($photo);
44
    }
45
46
}
47