See: file_exists()
Usage:
if (!file_exists($path)) {
// path does not exist
}
In Laravel:
if(!File::exists($path)) {
// path does not exist
}
Note: In Laravel
$pathstart frompublicfolder, so if you want to check'public/assets'folder the$path='assets'