im using laravel 5.4 and i want to delete folder. how can i delete a folder with a prefix using file facade?
for example it is my folder and code :
$folder = public_path().'/images/carimages/something_folder1';
File::deleteDirectory($file);
and now i want to do this : delete *_folder1
(all folders which will ends with _folder1
word)
------- Soloution :
$dir = public_path().'/images/carimages/*_folder1';
$dir = glob($dir);
$dir = implode(" ",$dir);
File::deleteDirectory($dir);