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
This code worked for me.
use Illuminate\Support\Facades\Storage; .... $storagePath = Storage::disk('local')->getDriver()->getAdapter()->getPathPrefix(); if(file_exists($storagePath.$file)) unlink($storagePath.$file);