[Files-Module] - How can you force delete a file (skip trash and remove the resource)
Created 6 years ago by edsterI have been trying to figure out how to delete a file from files module and resource, I know I can delete the file with Storage::
but I know there is a way to do it from the files module.
ryanthompson
—
6 years ago
edster
—
6 years ago
Thanks @ryanthompson, so do $model->forceDelete()
and that does the same?
What if I want to do this from a related stream/model.
I have a documents stream with a related file, (1-1) when I delete the document record, I want cascade and force delete the resource.
Storage::
is the bad practice. Use repositoriesFileRepositoryInterface $files->forceDelete()