original_string: protected function deleteFiles(Model $model, $forceDelete = false)
      {
          // If it's a soft delete, the files in the data will not be deleted.
          if (!$forceDelete && $this->isSoftDeletes) {
              return;
          }
  
          $data = $model->toArray();
  
          $this->builder->fields()->filter(function ($field) {
              return $field instanceof Field\File;
          })->each(function (Field\File $file) use ($data) {
              $file->setOriginal($data);
  
              $file->destroy();
          });
      }
code: protected function deleteFiles(Model $model, $forceDelete = false)
      {
          // If it's a soft delete, the files in the data will not be deleted.
          if (!$forceDelete && $this->isSoftDeletes) {
              return;
          }
  
          $data = $model->toArray();
  
          $this->builder->fields()->filter(function ($field) {
              return $field instanceof Field\File;
          })->each(function (Field\File $file) use ($data) {
              $file->setOriginal($data);
  
              $file->destroy();
          });
      }
code_tokens: protected function deleteFiles ( Model $ model , $ forceDelete = false ) { // If it's a soft delete, the files in the data will not be deleted. if ( ! $ forceDelete && $ this -> isSoftDeletes ) { return ; } $ data = $ model -> toArray ( ) ; $ this -> builder -> fields ( ) -> filter ( function ( $ field ) { return $ field instanceof Field \ File ; } ) -> each ( function ( Field \ File $ file ) use ( $ data ) { $ file -> setOriginal ( $ data ) ; $ file -> destroy ( ) ; } ) ; }
docstring: Remove files in record.
  
  @param Model $model
  @param bool  $forceDelete
docstring_tokens: Remove files in record .