Adldap\Laravel\Commands\Import::delete PHP Method

delete() protected method

Soft deletes the specified model if the specified AD account is disabled.
protected delete ( User $user, Model $model )
$user Adldap\Models\User
$model Illuminate\Database\Eloquent\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.");
            }
        }
    }