rabol's avatar
Level 14

Why does Storage::disk('local')->deleteDirectory($directory); not work

Hi

The user upload a picture and I save it using the Uploadfile from a form.

image is saver in a subfolder like this: $image->store('/user/' . auth()->user()->id . '/' . $doc->id, 'public'); returned path is correct and everything is fine.

Then later I want to delete the user and his images but it does not work.

$directory = '/user/' . auth()->user()->id; Storage::disk('local')->deleteDirectory($directory);

nothing is deleted

Any hints ?

0 likes
1 reply
rabol's avatar
Level 14

Crap.... When I save, i have the 'public' as second parameter so that should also be included when deleting

Please or to participate in this conversation.