如何处理来自流明的分页响应并使用jquery ajax在视图中打印出来?

时间:2019-04-08 15:09:04

标签: php jquery ajax laravel lumen

我尝试在我的laravel项目中进行分页。我正在从我的laravel发送ajax请求到api中的外部lumen,而jquery的响应如下:-

我如何进行分页?

先谢谢了。

{
    "current_page": 1,
    "data": [
        {
            "id": 1,
            "name": "brad",
            "email": "brad@gmail.com",
            "email_verified_at": null,
            "password": "$2y$10$qXZKHwLvS2cEWfeilpgR0u.N1SEq1ZkmO6UVEkcolfnFW5mjvjogO",
            "remember_token": "xKif1y6FC0EozLm93xFzCoYzVdOQ6QiYVNcEch2HRwzo10F5NvkSVolZgSIS",
            "created_at": "2018-11-15 04:16:45",
            "updated_at": "2018-11-15 04:16:45"
        },
        {
            "id": 2,
            "name": "Darrick Kovacek",
            "email": "krystel90@example.net",
            "email_verified_at": "2018-11-20 12:23:40",
            "password": "$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm",
            "remember_token": "Brn1D3xusG1G8UuX0NyE5qogrVyvcuViUBziF0YfeDhMZde4ZPekzuAS0ulU",
            "created_at": "2018-11-20 12:23:40",
            "updated_at": "2018-11-20 12:23:40"
        }
    ],
    "first_page_url": "http://localhost:8001/all?page=1",
    "from": 1,
    "last_page": 2,
    "last_page_url": "http://localhost:8001/all?page=2",
    "next_page_url": "http://localhost:8001/all?page=2",
    "path": "http://localhost:8001/all",
    "per_page": 2,
    "prev_page_url": null,
    "to": 2,
    "total": 4
}

0 个答案:

没有答案