Version 0.7.0 #1

Merged
kor-elf merged 90 commits from develop into main 2023-12-08 21:18:23 +06:00
Showing only changes of commit 9c1ed593b5 - Show all commits

View File

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\Builder;
final readonly class RoleRepository
{
final public function __construct(
public function __construct(
private CreateSearchInstanceCommand $createSearchInstanceCommand,
private BuilderCommand $builderCommand
) { }
@ -36,6 +36,16 @@ final readonly class RoleRepository
return $this->createSearchInstanceCommand->execute($query);
}
public function getRolesForSelect(array $withExcepts = []): array
{
return Role::query()
->when($withExcepts, function (Builder $query, array $withExcepts) {
$query->withTrashed()->whereNull('deleted_at')->orWhereIn('id', $withExcepts);
})
->pluck('name', 'id')
->toArray();
}
public function isExistsCode(string $code, ?int $exceptId = null): bool
{
return Role::query()