September 2017
Intermediate to advanced
244 pages
6h 44m
English
{data:[ { id:1, comment:"Awesome Post", post_id:1, link: "/comments/1" }, { id:2, comment:"Another post comment", post_id:1, link: "/comments/2" } ], total_count: 2, limit: 10, pagination: { first_page: "/posts/1/comments?page=1", last_page: "/posts/1/comments?page=1", page=1 } }
As you can see, a post's comments listing is very similar to a blog post's listing. And it has total_count and pagination in the same way. It shows the first and last page right now because total_count for the records is only 2. So there is no next or previous page. Otherwise, we should also have to show the next and previous links in pagination. ...
Read now
Unlock full access