JustSteveKing / laravel-envoyer-sdk

A simple to use PHP class to work with the Laravel Envoyer API
MIT License
36 stars 15 forks source link

Array returned instead of object on invalid project create #3

Closed ghost closed 3 years ago

ghost commented 3 years ago

Describe the bug An array is returned instead of the expected object: TypeError: Return value of JustSteveKing\Laravel\Envoyer\SDK\Resources\EnvoyerResource::save() must be an object or null, array returned in /Users/username/Sites/project/vendor/juststeveking/laravel-envoyer-sdk/src/Resources/EnvoyerResource.php:50

This happens when the API returns an error, To reproduce it all you have to do is send some invalid data :). I'm not sure why though, because json_decode should return an object like it is in the code.

JustSteveKing commented 3 years ago

Thanks for this one @thatsalltheyare I will have a look into this!

JustSteveKing commented 3 years ago

@thatsalltheyare please see the latest release, hopefully this solved your problem! Sorry for the delay, my wife gave birth since I commented