How to check File exist in Folder in Laravel – Developersmap.com
In this article, I will show you how to check file in folder exists or not.if you required to check if file is exists or not in given path then you can check easily.
Use Code :
public function delete() { if (File::exists(public_path('upload/demo.jpg'))) { dd('yes Exists'); }else{ dd('Not Exists'); } } public function index() { if (Storage::exists(public_path('upload/demo.jpg'))) { dd('yes Exists'); }else{ dd('Not Exists'); } }
Share