-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodule.php
More file actions
32 lines (29 loc) · 1.38 KB
/
module.php
File metadata and controls
32 lines (29 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
declare(strict_types=1);
use Marko\AdminAuth\AdminUserProvider;
use Marko\AdminAuth\Config\AdminAuthConfig;
use Marko\AdminAuth\Config\AdminAuthConfigInterface;
use Marko\AdminAuth\Repository\AdminUserRepository;
use Marko\AdminAuth\Repository\AdminUserRepositoryInterface;
use Marko\AdminAuth\Repository\PermissionRepository;
use Marko\AdminAuth\Repository\PermissionRepositoryInterface;
use Marko\AdminAuth\Repository\RoleRepository;
use Marko\AdminAuth\Repository\RoleRepositoryInterface;
use Marko\Authentication\Contracts\PasswordHasherInterface;
use Marko\Authentication\Contracts\UserProviderInterface;
use Marko\Core\Container\ContainerInterface;
return [
'bindings' => [
AdminAuthConfigInterface::class => AdminAuthConfig::class,
AdminUserRepositoryInterface::class => AdminUserRepository::class,
RoleRepositoryInterface::class => RoleRepository::class,
PermissionRepositoryInterface::class => PermissionRepository::class,
UserProviderInterface::class => function (ContainerInterface $container): UserProviderInterface {
return new AdminUserProvider(
userRepository: $container->get(AdminUserRepositoryInterface::class),
roleRepository: $container->get(RoleRepositoryInterface::class),
passwordHasher: $container->get(PasswordHasherInterface::class),
);
},
],
];