mirror of
https://gitlab.com/izyim/prototypes/ddd-example.git
synced 2026-08-22 14:04:11 +00:00
Create User Zone
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Src\Zone\User\Application\UseCases\Queries;
|
||||
|
||||
use Src\Zone\User\Domain\Policies\UserPolicy;
|
||||
use Src\Zone\User\Domain\Repositories\UserRepositoryInterface;
|
||||
use Src\Common\Domain\QueryInterface;
|
||||
|
||||
class FindAllUsersQuery implements QueryInterface
|
||||
{
|
||||
private UserRepositoryInterface $repository;
|
||||
private UserPolicy $policy;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->repository = app()->make(UserRepositoryInterface::class);
|
||||
$this->policy = new UserPolicy();
|
||||
}
|
||||
|
||||
public function handle(): array
|
||||
{
|
||||
authorize('findAll', $this->policy);
|
||||
return $this->repository->findAll();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user