Devise\Users\Groups\GroupsRepository::groupListForUser PHP Method

groupListForUser() public method

Get a list of groups for the given user id
public groupListForUser ( integer $userId ) : array
$userId integer
return array
    public function groupListForUser($userId)
    {
        return $this->User->findOrFail($userId)->groups()->lists('name', 'id')->all();
    }