How is laravel paged data formatted?

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
}

I wrapped it myself to simplify the output, as follows:

  

manually process the return value of laravel before returning to the client, but this process is not very elegant. Let's see if we can communicate with the front end to solve your needs.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea3c5e-1c86.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea3c5e-1c86.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?