I want to delete a file that is stored in storage/app/myfolder/file.jpg. I have tried the following codes but none of this works:
use File
$file_path = u
The delete method accepts a single filename or an array of files to remove from the disk:
use Illuminate\Support\Facades\Storage;
Storage::delete('file.jpg');
Storage::delete(['file.jpg', 'file2.jpg']);
If necessary, you may specify the disk that the file should be deleted from:
use Illuminate\Support\Facades\Storage;
Storage::disk('s3')->delete('folder_path/file_name.jpg');
Delete A Directory
Finally, the deleteDirectory method may be used to remove a directory and all of its files:
Storage::deleteDirectory($directory);