thanks for the reply I changed my code, but it's still throwing an error
$changeRole = $users->get($sanitizer->username('username'));
//add role
$changeRole->addRole('moderator');
//save changes
$users->save($changeRole);
Do I need to be using:
$users->of(true);
or
$changeRole>roles->add($roles->get('moderator));