/** * searchMember * * @param MemberRepositoryInterface $memberRepo * @param null $keyword * * @return \Xpressengine\Presenter\RendererInterface */ public function searchMember(MemberRepositoryInterface $memberRepo, $keyword = null) { if ($keyword === null) { return Presenter::makeApi($memberRepo->all()); } $matchedMemberList = $memberRepo->search(['displayName' => $keyword])->items(); return Presenter::makeApi($matchedMemberList); }