jmurphy1267's avatar

Laravel delete a file

I am trying to delete a file that I upload in a folder in the storage directory called avatars and I can delete it with unlink but storage disk does not work.

This works but

unlink(storage_path($url_local));

this does not

$test = Storage::delete(storage_path($url_local));

I looked at the source code and I do not see anything that would make it not work. I have used disk('local') and that does not work either.

0 likes
4 replies
rin4ik's avatar

with this?

$test = Storage::delete('storage/'. $url_local );
Vilfago's avatar

What is the path of your default storage ? (see filesystems.php in config folder)

jmurphy1267's avatar

@Vilfago my default is s3 but I event tried using disk('local') and it does not work. I just use the local file system for a middle point before I send it to s3

Please or to participate in this conversation.