Permission   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A roles() 0 4 1
1
<?php
2
3
namespace Yard8\LaravelPermissions\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Permission extends Model
8
{
9
    /**
10
     * Indicates if the IDs are auto-incrementing.
11
     *
12
     * @var bool
13
     */
14
    public $incrementing = false;
15
16
    /**
17
     * The "type" of the auto-incrementing ID.
18
     *
19
     * @var string
20
     */
21
    protected $keyType = 'string';
22
23
    /**
24
     * Indicates if the model should be timestamped.
25
     *
26
     * @var bool
27
     */
28
    public $timestamps = false;
29
30
    /**
31
     * The attributes that are mass assignable.
32
     *
33
     * @var array
34
     */
35
    protected $fillable = [
36
        'id', 'group'
37
    ];
38
39
    /**
40
     * Get the roles who have this permission by default.
41
     */
42
    public function roles()
43
    {
44
        return $this->belongsToMany(Role::class);
45
    }
46
}
47