Role::permissions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Yard8\LaravelPermissions\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Role extends Model
8
{
9
    /**
10
     * Indicates if the model should be timestamped.
11
     *
12
     * @var bool
13
     */
14
    public $timestamps = false;
15
16
    /**
17
     * The attributes that are mass assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = [
22
        'name'
23
    ];
24
25
    /**
26
     * Get the permissions this role has by default.
27
     */
28
    public function permissions()
29
    {
30
        return $this->belongsToMany(Permission::class);
31
    }
32
}
33