Skip to content

Commit 647a8f4

Browse files
committed
replaced controllers with handlers WIP
Signed-off-by: MarioRadu <magda_marior@yahoo.com>
1 parent 4d96642 commit 647a8f4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1931
-756
lines changed

config/autoload/navigation.global.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
[
1515
'options' => [
1616
'label' => 'Dashboard',
17-
'uri' => '/',
1817
'route' => [
19-
'route_name' => 'dashboard',
18+
'route_name' => 'page::dashboard',
2019
],
2120
'icon' => 'c-blue-500 ti-home',
2221
],
@@ -31,23 +30,26 @@
3130
[
3231
'options' => [
3332
'label' => 'Admins',
34-
'uri' => '/admin/list',
33+
'route' => [
34+
'route_name' => 'admin::list',
35+
],
3536
],
3637
],
3738
[
3839
'options' => [
3940
'label' => 'Logins',
40-
'uri' => '/admin/logins',
41+
'route' => [
42+
'route_name' => 'admin::list-logins',
43+
],
4144
],
4245
],
4346
],
4447
],
4548
[
4649
'options' => [
4750
'label' => 'Components',
48-
'uri' => '/page/components',
4951
'route' => [
50-
'route_name' => 'page',
52+
'route_name' => 'page::components',
5153
],
5254
'icon' => 'c-pink-500 ti-palette',
5355
],
@@ -63,10 +65,7 @@
6365
'options' => [
6466
'label' => 'Profile',
6567
'route' => [
66-
'route_name' => 'admin',
67-
'route_params' => [
68-
'action' => 'account',
69-
],
68+
'route_name' => 'admin::account',
7069
],
7170
'icon' => 'ti-user',
7271
],
@@ -75,10 +74,7 @@
7574
'options' => [
7675
'label' => 'Logout',
7776
'route' => [
78-
'route_name' => 'admin',
79-
'route_params' => [
80-
'action' => 'logout',
81-
],
77+
'route_name' => 'admin::logout',
8278
],
8379
'icon' => 'ti-power-off',
8480
],

src/Admin/src/ConfigProvider.php

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@
1414
use Admin\Admin\Form\AdminForm;
1515
use Admin\Admin\Form\ChangePasswordForm;
1616
use Admin\Admin\Form\LoginForm;
17+
use Admin\Admin\Handler\AdminListHandler;
18+
use Admin\Admin\Handler\AdminListLoginHandler;
19+
use Admin\Admin\Handler\ChangePasswordHandler;
20+
use Admin\Admin\Handler\CreateAdminHandler;
21+
use Admin\Admin\Handler\DeleteAdminHandler;
22+
use Admin\Admin\Handler\EditAccountHandler;
23+
use Admin\Admin\Handler\EditAdminHandler;
24+
use Admin\Admin\Handler\GetAccountFormHandler;
25+
use Admin\Admin\Handler\GetAdminFormHandler;
26+
use Admin\Admin\Handler\GetDeleteAdminFormHandler;
27+
use Admin\Admin\Handler\GetEditAdminFormHandler;
28+
use Admin\Admin\Handler\GetLoginFormHandler;
29+
use Admin\Admin\Handler\LoginHandler;
30+
use Admin\Admin\Handler\LogoutHandler;
1731
use Admin\Admin\Repository\AdminLoginRepository;
1832
use Admin\Admin\Repository\AdminRepository;
1933
use Admin\Admin\Repository\AdminRoleRepository;
@@ -52,15 +66,29 @@ public function getDependencies(): array
5266
],
5367
],
5468
'factories' => [
55-
AdminController::class => AttributedServiceFactory::class,
56-
AdminService::class => AttributedServiceFactory::class,
57-
AdminRoleService::class => AttributedServiceFactory::class,
58-
AdminRepository::class => AttributedRepositoryFactory::class,
59-
AdminRoleRepository::class => AttributedRepositoryFactory::class,
60-
AdminLoginRepository::class => AttributedRepositoryFactory::class,
61-
AdminForm::class => ElementFactory::class,
62-
AuthenticationService::class => AuthenticationServiceFactory::class,
63-
AuthenticationAdapter::class => AttributedServiceFactory::class,
69+
AdminController::class => AttributedServiceFactory::class,
70+
GetAdminFormHandler::class => AttributedServiceFactory::class,
71+
CreateAdminHandler::class => AttributedServiceFactory::class,
72+
GetEditAdminFormHandler::class => AttributedServiceFactory::class,
73+
EditAdminHandler::class => AttributedServiceFactory::class,
74+
GetDeleteAdminFormHandler::class => AttributedServiceFactory::class,
75+
DeleteAdminHandler::class => AttributedServiceFactory::class,
76+
AdminListHandler::class => AttributedServiceFactory::class,
77+
AdminListLoginHandler::class => AttributedServiceFactory::class,
78+
GetAccountFormHandler::class => AttributedServiceFactory::class,
79+
EditAccountHandler::class => AttributedServiceFactory::class,
80+
ChangePasswordHandler::class => AttributedServiceFactory::class,
81+
GetLoginFormHandler::class => AttributedServiceFactory::class,
82+
LoginHandler::class => AttributedServiceFactory::class,
83+
LogoutHandler::class => AttributedServiceFactory::class,
84+
AdminService::class => AttributedServiceFactory::class,
85+
AdminRoleService::class => AttributedServiceFactory::class,
86+
AdminRepository::class => AttributedRepositoryFactory::class,
87+
AdminRoleRepository::class => AttributedRepositoryFactory::class,
88+
AdminLoginRepository::class => AttributedRepositoryFactory::class,
89+
AdminForm::class => ElementFactory::class,
90+
AuthenticationService::class => AuthenticationServiceFactory::class,
91+
AuthenticationAdapter::class => AttributedServiceFactory::class,
6492
],
6593
'aliases' => [
6694
AdminInterface::class => Admin::class,

0 commit comments

Comments
 (0)