Skip to content

Commit 791e3d8

Browse files
committed
implement CloudinaryAdapter::has() method
1 parent ab0dc2d commit 791e3d8

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/CloudinaryAdapter.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use League\Flysystem\Config;
1010
use Illuminate\Support\Str;
1111

12-
1312
/**
1413
* Class CloudinaryAdapter
1514
* @package CloudinaryLabs\CloudinaryLaravel
@@ -228,7 +227,12 @@ public function createDir($dirname, Config $options)
228227
*/
229228
public function has($path)
230229
{
231-
return file_exists($path);
230+
try {
231+
$this->adminApi()->asset($path);
232+
} catch (NotFound $e) {
233+
return false;
234+
}
235+
return true;
232236
}
233237

234238
/**
@@ -266,8 +270,7 @@ public function readStream($path)
266270
* List contents of a directory.
267271
*
268272
* @param string $directory
269-
* @param bool $hasR ecursive
270-
*
273+
* @param bool $hasRecursive
271274
* @return array
272275
*/
273276
public function listContents($directory = '', $hasRecursive = false)

0 commit comments

Comments
 (0)