Total Complexity | 8 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class LaravelNovaPermission extends Tool |
||
9 | { |
||
10 | public $roleResource = Role::class; |
||
11 | public $permissionResource = Permission::class; |
||
12 | |||
13 | public $registerCustomResources = false; |
||
14 | |||
15 | /** |
||
16 | * Perform any tasks that need to happen when the tool is booted. |
||
17 | */ |
||
18 | public function boot() |
||
19 | { |
||
20 | if ((Role::class === $this->roleResource && Permission::class === $this->permissionResource) |
||
21 | || $this->registerCustomResources) { |
||
22 | Nova::resources([ |
||
23 | $this->roleResource, |
||
24 | $this->permissionResource, |
||
25 | ]); |
||
26 | } |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Set a custom Role resource class. |
||
31 | * |
||
32 | * @param Role resource class |
||
33 | * |
||
34 | * @return $this |
||
35 | */ |
||
36 | public function roleResource(string $roleResource) |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Set a custom Permission resource class. |
||
45 | * |
||
46 | * @param Permission resource class |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | public function permissionResource(string $permissionResource) |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Register the custom resource classes. |
||
59 | * |
||
60 | * @param bool |
||
61 | * |
||
62 | * @return $this |
||
63 | */ |
||
64 | public function withRegistration() |
||
65 | { |
||
66 | $this->registerCustomResources = true; |
||
67 | |||
68 | return $this; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * Build the view that renders the navigation links for the tool. |
||
73 | * |
||
74 | * @return \Illuminate\View\View |
||
75 | */ |
||
76 | public function renderNavigation() |
||
79 | } |
||
80 | } |
||
81 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths