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
Try:
unlink(public_path('uploads\users'). DIRECTORY_SEPARATOR .$user->image);
This worked for me..
Use storage
//demo use Illuminate\Support\Facades\Storage; Storage::delete($filename);
Another way,
unlink(storage_path('app/folder/'.$filename));