Downloads
Stars
Version
Laravel paginator 自定义分页扩展包
composer require themismin/laravel-paginator
// 结果会多出一个自定义数据
$custom = 'xxx';
$list = User::customPaginate($custom = null, $perPage = 15, $columns = ['*'], $pageName = 'page', $page = null);
return $list;
// 结果
{
"custom": "xxx",
"data": [
{
"name": "x1",
"date": "xxxx-xx-xx"
},
{
"name": "x2",
"date": "xxxx-xx-xx"
}
],
"page_size": 15,
"current": 1,
"total": 2
}