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

Permission   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 34
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A 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