| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | trait Commands |
||
| 10 | { |
||
| 11 | use Searchable; |
||
| 12 | |||
| 13 | protected $slug; |
||
| 14 | |||
| 15 | protected function slug(): string |
||
| 16 | { |
||
| 17 | if (is_null($this->slug)) { |
||
| 18 | $slug = $this->argument('slug'); |
||
|
|
|||
| 19 | |||
| 20 | $this->slug = Str::slug($slug, '_'); |
||
| 21 | } |
||
| 22 | |||
| 23 | return $this->slug; |
||
| 24 | } |
||
| 25 | |||
| 26 | protected function roleIsExist(): bool |
||
| 29 | } |
||
| 30 | |||
| 31 | protected function roleIsDoesntExist(): bool |
||
| 32 | { |
||
| 33 | return ! $this->roleIsExist(); |
||
| 34 | } |
||
| 35 | |||
| 36 | protected function permissionIsExist(): bool |
||
| 37 | { |
||
| 38 | return $this->searchExist(Permission::class, $this->slug()); |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function permissionIsDoesntExist(): bool |
||
| 44 | } |
||
| 45 | } |
||
| 46 |