*/ final class AdminUserRepository extends BaseRepository { public function __construct(protected readonly AdminUser $model) {} /** * @param string $username * @return AdminUser|null */ public function findByUserName(string $username): AdminUser|null { // @phpstan-ignore-next-line return $this->model->newQuery() ->where('username', $username) ->first(); } /** * @param mixed $id * @return array|null */ public function findById(mixed $id): ?array { return $this->getQuery()->whereKey($id)->first()?->toArray() ?? null; } }