File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 99use League \Flysystem \Config ;
1010use 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 /**
@@ -240,7 +244,7 @@ public function has($path)
240244 */
241245 public function read ($ path )
242246 {
243- $ resource = (array )$ this ->adminApi ()->resource ($ path );
247+ $ resource = (array )$ this ->adminApi ()->asset ($ path );
244248 $ contents = file_get_contents ($ resource ['secure_url ' ]);
245249
246250 return compact ('contents ' , 'path ' );
@@ -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 )
You can’t perform that action at this time.
0 commit comments