use Illuminate\Filesystem\Filesystem; $filesystem = new Filesystem(); if ($filesystem->exists('/path/to/file.jpg')) { echo 'File exists!'; } else { echo 'File does not exist'; }
use Illuminate\Filesystem\Filesystem; $filesystem = new Filesystem(); if ($filesystem->exists('/path/to/directory')) { echo 'Directory exists!'; } else { echo 'Directory does not exist'; }Overall, the `Illuminate\Filesystem` package is a powerful and versatile package for working with files and directories in PHP.