Role   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 2
Bugs 1 Features 1
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 16
rs 10
c 2
b 1
f 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A rights() 0 4 1
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