src/Stevemo/Cpanel/User/Repo/UserRepository.php
protected function syncGroups(array $groups, UserInterface $user)
    {
        $user->groups()->detach();
        $user->groups()->sync($groups);
    }
protected function syncGroups(array $groups, UserInterface $user)
    {
        $user->groups()->detach();
        $user->groups()->sync($groups);
    }
protected function syncGroups ( array $ groups , UserInterface $ user ) { $ user -> groups ( ) -> detach ( ) ; $ user -> groups ( ) -> sync ( $ groups ) ; }
Add groups to a user

@author Steve Montambeault
@link   http://stevemo.ca

@param array                                 $groups
@param \Cartalyst\Sentry\Users\UserInterface $user
Add groups to a user