Closed ChrisHardie closed 2 years ago
It looks like the issue is that the API key provided by Cloudflare within the Images interface is not actually able to access that API endpoint, but is instead for signing private image URLs. Instead, I had to generate an API key at https://dash.cloudflare.com/profile/api-tokens and give it edit access to the Images feature, and now I'm getting results. (I also had to make sure to run artisan config:cache
to recreate the config cache after updating the value of CLOUDFLARE_IMAGES_KEY
.
Thank you! I'll take a look at that and let you know
@ChrisHardie , thank you! You were right, issue is related to incorrect key! Added catch
to provide correct error in such cases
@ChrisHardie , thank you! You were right, issue is related to incorrect key! Added
catch
to provide correct error in such cases
It's back. It seems in some cases Cloudflare returns an empty response or something.
In BaseResponse.php line 55:
DeDmytro\CloudflareImages\Http\Responses\BaseResponse::fromArray(): Argument #1 ($array) must
be of type array, null given, called in /var/www/production-api/vendor/dedmytro/laravel-clou
dflare-images/src/Http/Clients/ImagesApiClient.php on line 75
Note this has nothing to do with account issues like incorrect token because most uploads work fine, a couple are not returning valid responses for whatever reason.
Description:
Hi! Thanks for creating this package. When just getting started, I'm hitting an exception when trying to do basic things like list existing files:
I'm wondering if you have any guidance. Thank you.
Steps To Reproduce:
CloudflareApi::images()->list()
I confirmed that these vars are set in
.env
: