Passed
Push — tailwind ( c12b72...6ef5b5 )
by Fèvre
05:05
created

Permission::boot()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 12
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A Permission::slugStrategy() 0 3 1
1
<?php
2
namespace Xetaravel\Models;
3
4
use Ultraware\Roles\Contracts\PermissionHasRelations as PermissionHasRelationsContract;
5
use Ultraware\Roles\Traits\PermissionHasRelations;
6
7
class Permission extends Model implements PermissionHasRelationsContract
8
{
9
    use PermissionHasRelations;
10
11
    /**
12
     * The attributes that are mass assignable.
13
     *
14
     * @var array
15
     */
16
    protected $fillable = [
17
        'name',
18
        'slug',
19
        'description',
20
        'model',
21
        'is_deletable'
22
    ];
23
24
    /**
25
     * The attributes that should be cast has a certain type.
26
     *
27
     * @var array
28
     */
29
    protected $cast = [
30
        'is_deletable' => 'boolean'
31
    ];
32
33
    /**
34
     * Return the field to slug.
35
     *
36
     * @return string
37
     */
38
    public function slugStrategy(): string
39
    {
40
        return 'name';
41
    }
42
}
43