@@ 17-38 (lines=22) @@ | ||
14 | use Longman\Platfourm\Contracts\Auth\AuthUserService as AuthUserServiceContract; |
|
15 | use Longman\Platfourm\Service\EntityService; |
|
16 | ||
17 | class InsertAccessLogService extends EntityService |
|
18 | { |
|
19 | protected $repository; |
|
20 | protected $authUserService; |
|
21 | ||
22 | public function __construct( |
|
23 | AuthUserServiceContract $authUserService, |
|
24 | AccessLogRepository $repository |
|
25 | ) { |
|
26 | $this->authUserService = $authUserService; |
|
27 | $this->repository = $repository; |
|
28 | } |
|
29 | ||
30 | public function run(array $data) |
|
31 | { |
|
32 | $this->checkRepository(); |
|
33 | ||
34 | $entity = $this->repository->create($data); |
|
35 | ||
36 | return $entity; |
|
37 | } |
|
38 | } |
|
39 |
@@ 16-39 (lines=24) @@ | ||
13 | use Longman\Platfourm\Contracts\Auth\AuthUserService; |
|
14 | use Longman\Platfourm\Service\EntityService; |
|
15 | ||
16 | class GetPermissionsByUserService extends EntityService |
|
17 | { |
|
18 | protected $repository; |
|
19 | protected $authUserService; |
|
20 | ||
21 | public function __construct( |
|
22 | AuthUserService $authUserService, |
|
23 | PermissionRepository $repository |
|
24 | ) { |
|
25 | $this->authUserService = $authUserService; |
|
26 | $this->repository = $repository; |
|
27 | ||
28 | //$authUserService->should('roles.*'); |
|
29 | } |
|
30 | ||
31 | public function run($user_id, $columns = ['*']) |
|
32 | { |
|
33 | $this->checkRepository(); |
|
34 | ||
35 | $entity = $this->repository->find($id, $columns); |
|
36 | return $entity; |
|
37 | } |
|
38 | ||
39 | } |
|
40 |