Passed
Pull Request — master (#4)
by
unknown
05:06
created

Permission::label()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Insenseanalytics\LaravelNovaPermission;
4
5
use Laravel\Nova\Resource;
0 ignored issues
show
Bug introduced by
The type Laravel\Nova\Resource 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Spatie\Permission\Models\Permission as SpatiePermission;
7
8
class Permission extends Resource
9
{
10
	use PermissionResourceTrait,TranslationHandelTrait {
11
	    TranslationHandelTrait::applyFilters insteadof PermissionResourceTrait;
12
    }
13
14
	/**
15
	 * The model the resource corresponds to.
16
	 *
17
	 * @var string
18
	 */
19
	public static $model = SpatiePermission::class;
20
21
	/**
22
	 * The single value that should be used to represent the resource when being displayed.
23
	 *
24
	 * @var string
25
	 */
26
	public static $title = 'name';
27
28
	/**
29
	 * The columns that should be searched.
30
	 *
31
	 * @var array
32
	 */
33
	public static $search = [
34
		'name',
35
	];
36
37
	/**
38
	 * Indicates if the resource should be displayed in the sidebar.
39
	 *
40
	 * @var bool
41
	 */
42
	public static $displayInNavigation = false;
43
44
    /**
45
     * Get the displayable label of the resource.
46
     *
47
     * @return string
48
     */
49
    public static function label()
50
    {
51
        return __('laravel-nova-permission::resources.Permissions');
0 ignored issues
show
Bug introduced by
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 ignore-call  annotation

51
        return /** @scrutinizer ignore-call */ __('laravel-nova-permission::resources.Permissions');
Loading history...
52
    }
53
54
    /**
55
     * Get the displayable singular label of the resource.
56
     *
57
     * @return string
58
     */
59
    public static function singularLabel()
60
    {
61
        return __('laravel-nova-permission::resources.Permission');
0 ignored issues
show
Bug introduced by
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 ignore-call  annotation

61
        return /** @scrutinizer ignore-call */ __('laravel-nova-permission::resources.Permission');
Loading history...
62
    }
63
64
}
65