public function deleteUserFromGroup($groupId, $userId)
    {
        try {
            $user = Sentry::getUserProvider()->findById($userId);
            $group = Sentry::getGroupProvider()->findById($groupId);
            $user->removeGroup($group);

            return Response::json(array('userDeleted' => true, 'message' => trans('syntara::groups.messages.user-removed-success'), 'messageType' => 'success'));
        } catch (\Cartalyst\Sentry\Users\UserNotFoundException $e) {
            return Response::json(array('userDeleted' => false, 'message' => trans('syntara::users.messages.not-found'), 'messageType' => 'danger'));
        } catch(\Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
            return Response::json(array('userDeleted' => false, 'message' => trans('syntara::groups.messages.not-found'), 'messageType' => 'danger'));
        }
    }
public function deleteUserFromGroup($groupId, $userId)
    {
        try {
            $user = Sentry::getUserProvider()->findById($userId);
            $group = Sentry::getGroupProvider()->findById($groupId);
            $user->removeGroup($group);

            return Response::json(array('userDeleted' => true, 'message' => trans('syntara::groups.messages.user-removed-success'), 'messageType' => 'success'));
        } catch (\Cartalyst\Sentry\Users\UserNotFoundException $e) {
            return Response::json(array('userDeleted' => false, 'message' => trans('syntara::users.messages.not-found'), 'messageType' => 'danger'));
        } catch(\Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
            return Response::json(array('userDeleted' => false, 'message' => trans('syntara::groups.messages.not-found'), 'messageType' => 'danger'));
        }
    }
public function deleteUserFromGroup ( $ groupId , $ userId ) { try { $ user = Sentry :: getUserProvider ( ) -> findById ( $ userId ) ; $ group = Sentry :: getGroupProvider ( ) -> findById ( $ groupId ) ; $ user -> removeGroup ( $ group ) ; return Response :: json ( array ( 'userDeleted' => true , 'message' => trans ( 'syntara::groups.messages.user-removed-success' ) , 'messageType' => 'success' ) ) ; } catch ( \ Cartalyst \ Sentry \ Users \ UserNotFoundException $ e ) { return Response :: json ( array ( 'userDeleted' => false , 'message' => trans ( 'syntara::users.messages.not-found' ) , 'messageType' => 'danger' ) ) ; } catch ( \ Cartalyst \ Sentry \ Groups \ GroupNotFoundException $ e ) { return Response :: json ( array ( 'userDeleted' => false , 'message' => trans ( 'syntara::groups.messages.not-found' ) , 'messageType' => 'danger' ) ) ; } }
Remove user from group
@param int $groupId
@param int $userId
@return Response
Remove user from group