public function removeRole($id, $role)
    {
        $user = $this->getUser($id);

        if (empty($user) || empty($role)) {
            return false;
        }

        // Remove the role from the $user['roles'] array.
        $user['roles'] = array_diff($user['roles'], [(string) $role]);

        return $this->saveUser($user);
    }
public function removeRole($id, $role)
    {
        $user = $this->getUser($id);

        if (empty($user) || empty($role)) {
            return false;
        }

        // Remove the role from the $user['roles'] array.
        $user['roles'] = array_diff($user['roles'], [(string) $role]);

        return $this->saveUser($user);
    }
public function removeRole ( $ id , $ role ) { $ user = $ this -> getUser ( $ id ) ; if ( empty ( $ user ) || empty ( $ role ) ) { return false ; } // Remove the role from the $user['roles'] array. $ user [ 'roles' ] = array_diff ( $ user [ 'roles' ] , [ ( string ) $ role ] ) ; return $ this -> saveUser ( $ user ) ; }
Remove a certain role from a specific user.

@param string|int $id
@param string     $role

@return bool
Remove a certain role from a specific user .