I 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.
Storage:: is the bad practice. Use repositories FileRepositoryInterface $files->forceDelete()
Ah you do it through the repository, thanks @piterden!
@edster you can technically do it with the model as well.
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.