Role::rights()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
namespace App\Model;
3
4
use Illuminate\Database\Eloquent\SoftDeletes;
5
6
/**
7
 * Class Role
8
 *
9
 * @property integer        $id
10
 * @property string         $name
11
 * @property string         $description
12
 * @property integer        $created_by
13
 * @property integer        $updated_by
14
 * @property \Carbon\Carbon $created_at
15
 * @property \Carbon\Carbon $updated_at
16
 * @property \Carbon\Carbon $deleted_at
17
 * @property-read Right[]   $rights
18
 *
19
 * @package App\Model
20
 */
21
final class Role extends BaseModel
22
{
23
    use SoftDeletes;
24
25
    protected $table = 'roles';
26
27
    protected $fillable = [
28
        'name',
29
        'description',
30
    ];
31
32
    public function rights()
33
    {
34
        return $this->belongsToMany('App\Model\Right', 'roles_to_rights', 'role_id', 'right_id');
35
    }
36
}
37