September 2017
Intermediate to advanced
244 pages
6h 44m
English
Here is the response of /api/posts endpoint (in my case, there is only one record in DB):
{ "current_page":1, "data":[ { "id":1, "title":"test", "status":"draft", "content":"test post", "user_id":2 } ], "from":1, "last_page":1, "next_page_url":null, "path":"http:\/\/localhost:8000\/api\/posts", "per_page":20, "prev_page_url":null, "to":1, "total":1}If you recall the response that we saw in Chapter 1, RESTful Web Services, Introduction and Motivation, you will see that we are getting most of the information that we discussed but we are getting it in a different format. Although that is perfectly fine as it is giving enough information, here is how we can make it similar to what we decided.
Here is what the index() ...
Read now
Unlock full access