Passed
Push — master ( 3b518a...cd2a02 )
by Adam
11:23
created

Role   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 41
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
A guide() 0 3 1
1
<?php
2
3
namespace Coyote\Guide;
4
5
use Coyote\Guide;
6
use Coyote\Models\Scopes\ForUser;
7
use Coyote\User;
8
use Illuminate\Database\Eloquent\Model;
9
10
class Role extends Model
11
{
12
    use ForUser;
13
14
    const JUNIOR = 'junior';
15
    const MID = 'mid';
16
    const SENIOR = 'senior';
17
18
    /**
19
     * The attributes that are mass assignable.
20
     *
21
     * @var array
22
     */
23
    protected $fillable = ['guide_id', 'user_id', 'role'];
24
25
    /**
26
     * The database table used by the model.
27
     *
28
     * @var string
29
     */
30
    protected $table = 'guide_roles';
31
32
    /**
33
     * @var array
34
     */
35
    public $timestamps = false;
36
37
    /**
38
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
39
     */
40
    public function guide()
41
    {
42
        return $this->belongsTo(Guide::class);
43
    }
44
45
    /**
46
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
47
     */
48
    public function user()
49
    {
50
        return $this->belongsTo(User::class)->withTrashed();
51
    }
52
}
53