hello guys, how are you?
I was looking for a way to return my models data formatted to my API Endpoints.
I am a laravel developer and there we use the ‘Resources’ which is a great way to format all my data before the response get sent to the client.
so if my model has fields like:
I can use an API Resource to print
- fullname ($name & surname)
- picture ($picture->url)
- role name ($role->name)
- member since ($created_at)
has Adonis anything similar, so i dont need to format my data inside the controller before sending it to he browser/client?
Laravel API Resources: https://laravel.com/docs/5.7/eloquent-resources