laravel delete file from path

Solutions on MaxInterview for laravel delete file from path by the best coders in the world

showing results for - "laravel delete file from path"
Angelo
06 Feb 2017
1You could use PHP unlink() method
2
3But if you want to do it the Laravel way, use the File::delete() method instead.
4  
5use Illuminate\Support\Facades\File; 
6  
7// Delete a single file
8File::delete($filename);
9
10// Delete multiple files
11File::delete($file1, $file2, $file3);
12
13// Delete an array of files\
14$files = array($file1, $file2);
15File::delete($files);