Test Setup Failed
Push — development ( 6f9037...ce0609 )
by Tim
03:47
created

User::break()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Auth\Authenticatable;
6
use Illuminate\Database\Eloquent\Model;
7
use Illuminate\Auth\Passwords\CanResetPassword;
8
use Illuminate\Foundation\Auth\Access\Authorizable;
9
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
10
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
11
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
12
use Silber\Bouncer\Database\HasRolesAndAbilities;
13
14
/**
15
 * @property mixed fname
16
 * @property mixed name
17
 * @property mixed address
18
 * @property mixed postal_code
19
 * @property mixed city
20
 * @property mixed email
21
 * @property mixed password
22
 */
23
class User extends Model implements AuthenticatableContract,
0 ignored issues
show
Coding Style introduced by
The first item in a multi-line implements list must be on the line following the implements keyword
Loading history...
24
                                    AuthorizableContract,
0 ignored issues
show
Coding Style introduced by
Expected 4 spaces before interface name; 36 found
Loading history...
25
                                    CanResetPasswordContract
0 ignored issues
show
Coding Style introduced by
Expected 4 spaces before interface name; 36 found
Loading history...
26
{
27
    use Authenticatable, Authorizable, CanResetPassword, HasRolesAndAbilities;
28
29
    /**
30
     * The database table used by the model.
31
     *
32
     * @var string
33
     */
34
    protected $table = 'users';
35
36
    /**
37
     * The attributes that are mass assignable.
38
     *
39
     * @var array
40
     */
41
    protected $fillable = ['name', 'fname', 'address', 'postal_code', 'city', 'country', 'email', 'password'];
42
43
    /**
44
     * The attributes excluded from the model's JSON form.
45
     *
46
     * @var array
47
     */
48
    protected $hidden = ['password', 'remember_token'];
49
50
    /**
51
     * Return the departments where the user is manager off.
52
     *
53
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
54
     */
55
    public function departmentManager()
56
    {
57
        return $this->belongsToMany('App\Departments');
58
    }
59
60
    /**
61
     * Return the teams where the user is in.
62
     *
63
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
64
     */
65
    public function teams()
66
    {
67
        return $this->belongsToMany('App\Teams');
68
    }
69
70
    /**
71
     * Users > Break Queue Relations
72
     *
73
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
74
     */
75
    public function breakQueue()
76
    {
77
        return $this->belongsToMany('App\BreakQueue');
78
    }
79
80
    /**
81
     * Users > break relation
82
     *
83
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
84
     */
85
    public function break()
86
    {
87
        return $this->belongsToMany('App\Break');
88
    }
89
}
90