Passed
Push — tailwind ( 65eec7...7db3ed )
by Fèvre
06:15
created

Role   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 12
c 1
b 0
f 0
dl 0
loc 35
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\RoleHasRelations as RoleHasRelationsContract;
5
use Ultraware\Roles\Traits\RoleHasRelations;
6
7
class Role extends Model implements RoleHasRelationsContract
8
{
9
    use RoleHasRelations;
10
11
    /**
12
     * The attributes that are mass assignable.
13
     *
14
     * @var array
15
     */
16
    protected $fillable = [
17
        'name',
18
        'slug',
19
        'description',
20
        'css',
21
        'level',
22
        'is_deletable'
23
    ];
24
25
    /**
26
     * The attributes that should be cast has a certain type.
27
     *
28
     * @var array
29
     */
30
    protected $cast = [
31
        'is_deletable' => 'boolean'
32
    ];
33
34
    /**
35
     * Return the field to slug.
36
     *
37
     * @return string
38
     */
39
    public function slugStrategy(): string
40
    {
41
        return 'name';
42
    }
43
}
44