original_string: protected function deleteModels(): void
      {
          $model = app($this->modelClass);
          // determine if the model uses `SoftDeletes` trait
          $usesSoftDeletes = in_array(SoftDeletes::class, class_uses($model));
  
          foreach ($model->all() as $value) {
              try {
                  if ($usesSoftDeletes) {
                      $value->forceDelete();
                  } else {
                      $value->delete();
                  }
              } catch (Exception $exception) {
                  Log::warning(sprintf('Error during deleting models. Table: %s. Error: %s', $model->getTable(), $exception->getMessage()));
              }
          }
      }
code: protected function deleteModels(): void
      {
          $model = app($this->modelClass);
          // determine if the model uses `SoftDeletes` trait
          $usesSoftDeletes = in_array(SoftDeletes::class, class_uses($model));
  
          foreach ($model->all() as $value) {
              try {
                  if ($usesSoftDeletes) {
                      $value->forceDelete();
                  } else {
                      $value->delete();
                  }
              } catch (Exception $exception) {
                  Log::warning(sprintf('Error during deleting models. Table: %s. Error: %s', $model->getTable(), $exception->getMessage()));
              }
          }
      }
code_tokens: protected function deleteModels ( ) : void { $ model = app ( $ this -> modelClass ) ; // determine if the model uses `SoftDeletes` trait $ usesSoftDeletes = in_array ( SoftDeletes :: class , class_uses ( $ model ) ) ; foreach ( $ model -> all ( ) as $ value ) { try { if ( $ usesSoftDeletes ) { $ value -> forceDelete ( ) ; } else { $ value -> delete ( ) ; } } catch ( Exception $ exception ) { Log :: warning ( sprintf ( 'Error during deleting models. Table: %s. Error: %s' , $ model -> getTable ( ) , $ exception -> getMessage ( ) ) ) ; } } }
docstring: Removes all existing models.
  
  @throws Exception
docstring_tokens: Removes all existing models .