How to delete file from public folder in laravel 5.1

If you want to do it the Laravel way, use the File::delete() method.

Delete a single file:

File::delete($filename);

Delete multiple files:

File::delete($file1, $file2, $file3);

Delete an array of files:

$files = array($file1, $file2);
File::delete($files);

And don’t forget to add at the top:

use Illuminate\Support\Facades\File; 

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)