What is the proper syntax when deleting a folder with files in laravel 5.2?
Here is my syntax when deleting the folder from the DB and DIR
$folder = Folder::find($id);
$folder_path = storage_path('locker').'/'. $folder->folder_title;
$folder->delete();
`rmdir($folder_path);`
\Session::flash('success', 'Folder Deleted!');
return back();
After much frustration I got the solution.
Use ' File ' instead of ' Storage '
File::deleteDirectory($path);
The deleteDirectory may be used to remove a directory and all of its files
Storage::deleteDirectory($directory);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.