if you use the paginate () method in the framework for paging, the outer layer of the data will be wrapped in an extra layer of paging data, for example:
{
"total": 50,
"per_page": 15,
"current_page": 1,
"last_page": 4,
"next_page_url": "http://laravel.app?page=2",
"prev_page_url": null,
"from": 1,
"to": 15,
"data":[
{
// Result Object
},
{
// Result Object
}
]
}
how do I display paging data separately? For example:
"data":[
{
// Result Object
},
{
// Result Object
}
],
"page": {
"total": 50,
"per_page": 15,
"current_page": 1,
"last_page": 4,
"next_page_url": "http://laravel.app?page=2",
"prev_page_url": null,
"from": 1,
"to": 15
}