1 | <?php |
||
18 | class Permission extends Resource implements HasAbilities |
||
19 | { |
||
20 | use Authorizable, |
||
21 | HasFieldName; |
||
22 | |||
23 | public static $permissionsForAbilities = [ |
||
24 | 'viewAny' => 'viewAny permission', |
||
25 | 'view' => 'view permission', |
||
26 | 'create' => 'create permission', |
||
27 | 'update' => 'update permission', |
||
28 | 'delete' => 'delete permission', |
||
29 | ]; |
||
30 | |||
31 | /** |
||
32 | * The model the resource corresponds to. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | public static $model; |
||
37 | |||
38 | /** |
||
39 | * The single value that should be used to represent the resource when being displayed. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | public static $title = 'name'; |
||
44 | |||
45 | /** |
||
46 | * Get the search result subtitle for the resource. |
||
47 | * |
||
48 | * @return string|null |
||
49 | */ |
||
50 | public function subtitle() |
||
54 | |||
55 | /** |
||
56 | * The columns that should be searched. |
||
57 | * |
||
58 | * @var array |
||
59 | */ |
||
60 | public static $search = [ |
||
61 | 'name', |
||
62 | 'guard_name', |
||
63 | ]; |
||
64 | |||
65 | /** |
||
66 | * Get the displayable label of the resource. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | public static function label() |
||
74 | |||
75 | /** |
||
76 | * Get the displayable singular label of the resource. |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | public static function singularLabel() |
||
84 | |||
85 | /** |
||
86 | * Get the fields displayed by the resource. |
||
87 | * |
||
88 | * @param \Illuminate\Http\Request $request |
||
89 | * @return array |
||
90 | */ |
||
91 | public function fields(Request $request) |
||
128 | } |
||
129 |