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();
        });
    }
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();
        });
    }
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 ( ) ; } ) ; }
Remove files in record.

@param Model $model
@param bool  $forceDelete
Remove files in record .