cloudinary-community / cloudinary-laravel

Laravel SDK for Cloudinary
MIT License
255 stars 71 forks source link

fix response array conversion #70

Closed Mdhesari closed 1 year ago

Mdhesari commented 2 years ago

When deleting media, it always returns 0 event when the file is actually deleted, so I figured out the problem by tracing code and find out array conversion is not happening when retrieving media.

unicodeveloper commented 1 year ago

@Mdhesari not sure I get what you mean, there is a check on the next line for determining if the response is an array or not.

brandon14 commented 1 year ago

@unicodeveloper I think what he is saying, is the API call to destroy doesn't return an array, but rather an ApiResponse object. So the check for is_array will always fail without an explicit cast to an array. thus always returning false even on a sucess.

unicodeveloper commented 1 year ago

@brandon14 thanks for clarifying. I understand better now.