protected function deleteFilesAndImages($id)
    {
        $data = $this->model->with($this->getRelations())
            ->findOrFail($id)->toArray();

        $this->builder->fields()->filter(function ($field) {
            return $field instanceof Field\File;
        })->each(function (File $file) use ($data) {
            $file->setOriginal($data);

            $file->destroy();
        });
    }
protected function deleteFilesAndImages($id)
    {
        $data = $this->model->with($this->getRelations())
            ->findOrFail($id)->toArray();

        $this->builder->fields()->filter(function ($field) {
            return $field instanceof Field\File;
        })->each(function (File $file) use ($data) {
            $file->setOriginal($data);

            $file->destroy();
        });
    }
protected function deleteFilesAndImages ( $ id ) { $ data = $ this -> model -> with ( $ this -> getRelations ( ) ) -> findOrFail ( $ id ) -> toArray ( ) ; $ this -> builder -> fields ( ) -> filter ( function ( $ field ) { return $ field instanceof Field \ File ; } ) -> each ( function ( File $ file ) use ( $ data ) { $ file -> setOriginal ( $ data ) ; $ file -> destroy ( ) ; } ) ; }
Remove files or images in record.

@param $id
Remove files or images in record .