/**
* Soft deletes the specified model if the specified AD account is disabled.
*
* @param User $user
* @param Model $model
*/
protected function delete(User $user, Model $model)
{
if (method_exists($model, 'trashed') && !$model->trashed() && $user->isDisabled()) {
// If deleting is enabled, the model supports soft deletes, the model
// isn't already deleted, and the AD user is disabled, we'll
// go ahead and delete the users model.
$model->delete();
if ($this->isLogging()) {
logger()->info("Soft-deleted user {$user->getCommonName()}. Their AD user account is disabled.");
}
}
}