Completed
Push — master ( 92c593...aaa14d )
by Tim
03:08
created

User::departments()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
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\Foundation\Auth\User as Authenticatable;
6
use Silber\Bouncer\Database\HasRolesAndAbilities;
7
8
class User extends Authenticatable
9
{
10
    use HasRolesAndAbilities;
11
    
12
    /**
13
     * The attributes that are mass assignable.
14
     *
15
     * @var array
16
     */
17
    protected $fillable = [
18
        'fname', 'name', 'email', 'password', 'biography',
19
    ];
20
21
    /**
22
     * The attributes that should be hidden for arrays.
23
     *
24
     * @var array
25
     */
26
    protected $hidden = [
27
        'password', 'remember_token',
28
    ];
29
30
    /**
31
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
32
     */
33
    public function departments()
34
    {
35
        return $this->belongsToMany('App\Departments');
36
    }
37
}
38