API resources #4388
Closed
manomintis
started this conversation in
Ideas
API resources
#4388
Replies: 2 comments
-
We will need someone to work on this. It can easily be a separate package maintained by you or someone else. I do see API resources a useful abstraction to have, but I will not be able to work on it right now or in the near future. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just a note that the package is indeed created, find it here, https://github.com/manomintis/adonis-api-resources |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It looks like Adonis doesn't have anything like Laravel API resoucres, does it? It is really helpful for rendering a model and especially model collections in a few different ways, depending on endpoint or other conditions. For example, I might want to render more user fields to self than to others and more fields to admins than to self. So some fields must not be completely hidden in all cases (like password hash) but rather hidden sometimes only. Of course, it is possible to have this without having API resources as a feature, but then it doesn't look clean. The need is quiet common though. Please find more information about how it works in Laravel, https://laravel.com/docs/10.x/eloquent-resources
Beta Was this translation helpful? Give feedback.
All reactions