rabol
8 months ago

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

Posted 8 months ago by rabol

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 ?

Please sign in or create an account to participate in this conversation.