protected function syncModelPassword(Model $model, $password)
{
// If the developer doesn't want to synchronize AD passwords,
// we'll set the password to a random 16 character string.
$password = $this->getPasswordSync() ? $password : str_random();
// If the model has a set mutator for the password then
// we'll assume that the dev is using their own
// encryption method for passwords. Otherwise
// we'll bcrypt it normally.
$model->password = $model->hasSetMutator('password') ? $password : bcrypt($password);
return $model;
}