1 | <?php |
||||
2 | |||||
3 | namespace App\Admin\Sections; |
||||
4 | |||||
5 | use AdminColumn; |
||||
0 ignored issues
–
show
|
|||||
6 | use AdminDisplay; |
||||
0 ignored issues
–
show
The type
AdminDisplay 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 ![]() |
|||||
7 | use AdminForm; |
||||
0 ignored issues
–
show
The type
AdminForm 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 ![]() |
|||||
8 | use AdminFormElement; |
||||
0 ignored issues
–
show
The type
AdminFormElement 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 ![]() |
|||||
9 | use SleepingOwl\Admin\Contracts\Initializable; |
||||
10 | use SleepingOwl\Admin\Form\Buttons\Cancel; |
||||
11 | //use SleepingOwl\Admin\Form\Buttons\Save; |
||||
12 | use SleepingOwl\Admin\Form\Buttons\SaveAndClose; |
||||
13 | use SleepingOwl\Admin\Section; |
||||
14 | |||||
15 | class Roles extends Section implements Initializable |
||||
16 | { |
||||
17 | public function initialize() |
||||
18 | { |
||||
19 | } |
||||
20 | |||||
21 | protected $checkAccess = true; |
||||
22 | protected $alias = 'roles'; |
||||
23 | |||||
24 | public function getIcon() |
||||
25 | { |
||||
26 | return 'fas fa-user-shield'; |
||||
27 | } |
||||
28 | |||||
29 | public function getTitle() |
||||
30 | { |
||||
31 | return 'Роли'; |
||||
32 | } |
||||
33 | |||||
34 | public function getEditTitle() |
||||
35 | { |
||||
36 | return 'Редактирование роли'; |
||||
37 | } |
||||
38 | |||||
39 | public function onDisplay() |
||||
40 | { |
||||
41 | $display = AdminDisplay::table() |
||||
42 | ->setHtmlAttribute('class', 'table-danger table-hover'); |
||||
43 | |||||
44 | $display->setColumns([ |
||||
45 | AdminColumn::text('id', '#') |
||||
46 | ->setWidth('50px') |
||||
47 | ->setHtmlAttribute('class', 'text-center'), |
||||
48 | AdminColumn::link('name', 'Название') |
||||
49 | ->setWidth('150px'), |
||||
50 | AdminColumn::text('description', 'Описание'), |
||||
51 | ]); |
||||
52 | |||||
53 | return $display; |
||||
54 | } |
||||
55 | |||||
56 | public function onEdit($id) |
||||
0 ignored issues
–
show
The parameter
$id 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. ![]() |
|||||
57 | { |
||||
58 | $form = AdminForm::panel()->addBody([ |
||||
59 | AdminFormElement::text('id', '#') |
||||
60 | ->setReadonly(1), |
||||
61 | AdminFormElement::text('name', 'Название') |
||||
62 | ->required() |
||||
63 | ->addValidationRule('max:190', __('adm.valid.max190')), |
||||
64 | AdminFormElement::textarea('description', 'Описание') |
||||
65 | ->setRows(3) |
||||
66 | ->addValidationRule('max:190', __('adm.valid.max190')), |
||||
67 | ]); |
||||
68 | |||||
69 | $form->getButtons()->setButtons([ |
||||
70 | // 'save' => new Save(), |
||||
71 | 'save_and_close' => new SaveAndClose(), |
||||
72 | 'cancel' => (new Cancel()), |
||||
73 | ]); |
||||
74 | |||||
75 | return $form; |
||||
76 | } |
||||
77 | } |
||||
78 |
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