G
G
GaserV2017-07-19 19:18:24
Laravel
GaserV, 2017-07-19 19:18:24

Why doesn't Storage::delete() delete the file?

Good evening! Faced such a problem. Storage doesn't delete the file, while it deletes the directory normally.
The folder is deleted normally:

$directory = $user_id.'/'.$folder->slug;
          $folder->delete();
          Storage::deleteDirectory($directory);

But the file is not:
$file = File::find($id);
          $directory = $user_id.'/'.$file->folder->slug.$file->hash_name;
          Storage::delete($directory);

PS The file and directory are deleted in different methods.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2017-07-19
@kentuck1213

Directories need to be given the truth. sudo chmod -R 777 my_path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question