In this PHP Laravel Tutorial, I will let you know how to first check if a file exists and then delete file from public folder.
In general web development, you store the file to local disk and save the reference file name in your database but when you delete the reference from the database then it is require to delete the file from the disk.
And in Laravel PHP, It is very easy to check if file exists on given location and delete it from the given path
In Laravel, you can use File Facade or Storage Facade to delete file.Remove file using File Facade
But it is very necessary to check if file exists on given location before deleting it and you can easily check from given line of code:Remove file using Storage Facade
Use below line of code to check if file exists or not using Storage Facade