insenseanalytics /
laravel-nova-permission
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace Insenseanalytics\LaravelNovaPermission; |
||||
| 4 | |||||
| 5 | use Laravel\Nova\Http\Requests\NovaRequest; |
||||
|
0 ignored issues
–
show
|
|||||
| 6 | use Laravel\Nova\Nova; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Nova was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 7 | use Laravel\Nova\Fields\ID; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Fields\ID was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 8 | use Illuminate\Http\Request; |
||||
| 9 | use Laravel\Nova\Fields\Text; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Fields\Text was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 10 | use Illuminate\Validation\Rule; |
||||
|
0 ignored issues
–
show
The type
Illuminate\Validation\Rule was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 11 | use Laravel\Nova\Fields\Select; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Fields\Select was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 12 | use Laravel\Nova\Fields\DateTime; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Fields\DateTime was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 13 | use Laravel\Nova\Fields\MorphToMany; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Fields\MorphToMany was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 14 | use Laravel\Nova\Fields\BelongsToMany; |
||||
|
0 ignored issues
–
show
The type
Laravel\Nova\Fields\BelongsToMany was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 15 | use Spatie\Permission\PermissionRegistrar; |
||||
| 16 | |||||
| 17 | trait PermissionResourceTrait |
||||
| 18 | { |
||||
| 19 | public static function getModel() |
||||
| 20 | { |
||||
| 21 | return app(PermissionRegistrar::class)->getPermissionClass(); |
||||
|
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 22 | } |
||||
| 23 | |||||
| 24 | /** |
||||
| 25 | * Get the fields displayed by the resource. |
||||
| 26 | * |
||||
| 27 | * @param \Illuminate\Http\Request $request |
||||
| 28 | * |
||||
| 29 | * @return array |
||||
| 30 | */ |
||||
| 31 | public function fields(Request $request) |
||||
|
0 ignored issues
–
show
The parameter
$request is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 32 | { |
||||
| 33 | $guardOptions = collect(config('auth.guards'))->mapWithKeys(function ($value, $key) { |
||||
|
0 ignored issues
–
show
The function
config was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 34 | return [$key => $key]; |
||||
| 35 | }); |
||||
| 36 | |||||
| 37 | $userResource = Nova::resourceForModel(getModelForGuard($this->guard_name)); |
||||
| 38 | |||||
| 39 | $roleResource = Nova::resourceForModel(app(PermissionRegistrar::class)->getRoleClass()); |
||||
|
0 ignored issues
–
show
The function
app was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 40 | |||||
| 41 | return [ |
||||
| 42 | ID::make()->sortable(), |
||||
| 43 | |||||
| 44 | Text::make(__('laravel-nova-permission::permissions.name'), 'name') |
||||
|
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 45 | ->rules(['required', 'string', 'max:255']) |
||||
| 46 | ->creationRules('unique:' . config('permission.table_names.permissions')) |
||||
| 47 | ->updateRules('unique:' . config('permission.table_names.permissions') . ',name,{{resourceId}}'), |
||||
| 48 | |||||
| 49 | Text::make(__('laravel-nova-permission::permissions.display_name'),function (){ |
||||
| 50 | return __('laravel-nova-permission::permissions.display_names.'.$this->name); |
||||
|
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 51 | })->canSee(function (){ |
||||
| 52 | return is_array(__('laravel-nova-permission::permissions.display_names')); |
||||
|
0 ignored issues
–
show
The function
__ was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 53 | }), |
||||
| 54 | |||||
| 55 | Select::make(__('laravel-nova-permission::permissions.guard_name'), 'guard_name') |
||||
| 56 | ->options($guardOptions->toArray()) |
||||
| 57 | ->rules(['required', Rule::in($guardOptions)]), |
||||
| 58 | |||||
| 59 | DateTime::make(__('laravel-nova-permission::permissions.created_at'), 'created_at')->exceptOnForms(), |
||||
| 60 | |||||
| 61 | DateTime::make(__('laravel-nova-permission::permissions.updated_at'), 'updated_at')->exceptOnForms(), |
||||
| 62 | |||||
| 63 | BelongsToMany::make($roleResource::label(), 'roles', $roleResource)->searchable(), |
||||
| 64 | |||||
| 65 | MorphToMany::make($userResource::label(), 'users', $userResource)->searchable(), |
||||
| 66 | ]; |
||||
| 67 | } |
||||
| 68 | } |
||||
| 69 |
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