plugin/exo/Controller/Api/Item/ShareController.php
public function searchUsers($search)
    {
        $users = $this->userRepository->findByName($search);

        return new JsonResponse(array_map(function (User $user) {
            return $this->userSerializer->serialize($user);
        }, $users));
    }
public function searchUsers($search)
    {
        $users = $this->userRepository->findByName($search);

        return new JsonResponse(array_map(function (User $user) {
            return $this->userSerializer->serialize($user);
        }, $users));
    }
public function searchUsers ( $ search ) { $ users = $ this -> userRepository -> findByName ( $ search ) ; return new JsonResponse ( array_map ( function ( User $ user ) { return $ this -> userSerializer -> serialize ( $ user ) ; } , $ users ) ) ; }
Searches users by username, first or last name.

@EXT\Route("/{search}", name="questions_share_users")
@EXT\Method("GET")

@param string $search

@return JsonResponse
Searches users by username first or last name .