CristalTeam / php-api-wrapper

:rainbow: Work with APIs like with Laravel Eloquent or Doctrine (no longer a dream)
MIT License
117 stars 32 forks source link

What's the expected response format from the API? #21

Closed NourdineMazali closed 3 years ago

NourdineMazali commented 3 years ago

Hi All,

Thank you for the kickass package!

Just wondering what's the expected response format from the API, currently my API returns {data:{}, status: 'success'} which is not quite transforming to Eloquent like Object.

Thank you.

camillebaronnet commented 3 years ago

Hi! Thanks you a lot @NourdineMazali !

I recommend you to override the findOne method in your custom wrapper to send back only the child data or to throw an exception when the status child is wrong.