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 9
9
use League \Flysystem \Config ;
10
10
use Illuminate \Support \Str ;
11
11
12
-
13
12
/**
14
13
* Class CloudinaryAdapter
15
14
* @package CloudinaryLabs\CloudinaryLaravel
@@ -228,7 +227,12 @@ public function createDir($dirname, Config $options)
228
227
*/
229
228
public function has ($ path )
230
229
{
231
- return file_exists ($ path );
230
+ try {
231
+ $ this ->adminApi ()->asset ($ path );
232
+ } catch (NotFound $ e ) {
233
+ return false ;
234
+ }
235
+ return true ;
232
236
}
233
237
234
238
/**
@@ -240,7 +244,7 @@ public function has($path)
240
244
*/
241
245
public function read ($ path )
242
246
{
243
- $ resource = (array )$ this ->adminApi ()->resource ($ path );
247
+ $ resource = (array )$ this ->adminApi ()->asset ($ path );
244
248
$ contents = file_get_contents ($ resource ['secure_url ' ]);
245
249
246
250
return compact ('contents ' , 'path ' );
@@ -266,8 +270,7 @@ public function readStream($path)
266
270
* List contents of a directory.
267
271
*
268
272
* @param string $directory
269
- * @param bool $hasR ecursive
270
- *
273
+ * @param bool $hasRecursive
271
274
* @return array
272
275
*/
273
276
public function listContents ($ directory = '' , $ hasRecursive = false )
You can’t perform that action at this time.
0 commit comments