$per_page = $request->input("per_page", 20);
$users = DB::table('users')->paginate(15);
# 或者
$users = App\User::where('votes', '>', 100)->paginate($per_page);
foreach($users as $user){}
{
"total": 50,
"per_page": 15,
"current_page": 1,
"last_page": 4,
"first_page_url": "http://laravel.app?page=1",
"last_page_url": "http://laravel.app?page=4",
"next_page_url": "http://laravel.app?page=2",
"prev_page_url": null,
"path": "http://laravel.app",
"from": 1,
"to": 15,
"data":[
{
// 结果对象集
},
{
// 结果对象集
}
]
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。