Skeleton is ready
This commit is contained in:
26
app/Feature/Example/Service/UsersRepository.php
Normal file
26
app/Feature/Example/Service/UsersRepository.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Feature\Example\Service;
|
||||
|
||||
use App\Feature\Example\Dto\SearchUsers;
|
||||
use App\Models\User\User;
|
||||
use App\Shared\Service\User\SearchById;
|
||||
use Illuminate\Pagination\LengthAwarePaginator;
|
||||
|
||||
class UsersRepository extends SearchById
|
||||
{
|
||||
/**
|
||||
* @param \App\Feature\Example\Dto\SearchUsers $dto
|
||||
*
|
||||
* @return \Illuminate\Pagination\LengthAwarePaginator<\App\Models\User\User>
|
||||
*/
|
||||
public function search(SearchUsers $dto): LengthAwarePaginator
|
||||
{
|
||||
return User::query()->paginate(
|
||||
page: $dto->page->exists() ? $dto->page->value() : 1,
|
||||
perPage: $dto->perPage->exists() ? $dto->perPage->value() : 20,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user