lundi 30 mai 2016

Laravel 5.2/Dingo API resource link in the response

I'm trying to use Dingo API to implement RESTful backend APIs for our webapp. Best practices say that response payload should contain links to the returned resource objects. It can be in the form of _link or href. I don't see a way to include this in the response without handcrafting resource URL. I would like to have the response something like...

[
 { 
  'person': "Joe",
  '_link': 'http://ift.tt/1U7xa9S'
 },
 {
  'person': "Pat",
  '_link': 'http://ift.tt/1smJjBo'
 }
]

Is there a way I can include a resource link in the response?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire