Skip to content

Instantly share code, notes, and snippets.

@developerdino
Last active September 6, 2017 09:33
Show Gist options
  • Select an option

  • Save developerdino/db302c81620e0c4b3ba74327ace17594 to your computer and use it in GitHub Desktop.

Select an option

Save developerdino/db302c81620e0c4b3ba74327ace17594 to your computer and use it in GitHub Desktop.
Using Laravel 5.5 Resources to create your own {JSON:API} formatted API - Medium Gists
{
"links": {
"self": "http://example.com/articles",
"first": "http://example.com/articles?page=1",
"last": "http://example.com/articles?page=2",
"prev": null,
"next": "http://example.com/articles?page=2"
},
"data": [
{
"type": "articles",
"id": "1",
"attributes": {
"title": "JSON API paints my bikeshed!"
},
"links": {
"self": "http://example.com/api/articles/1"
}
},
{
"type": "articles",
"id": "2",
"attributes": {
"title": "Build APIs You Won't Hate"
},
"links": {
"self": "http://example.com/api/articles/2"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment