put a custom file path to store a file that is not in the storage folder in laravel code example
Example: laravel filesystem
$exists = Storage::disk('s3')->exists('file.jpg');
$exists = Storage::disk('s3')->exists('file.jpg');