1、vendor/laravel/framework/src/Illuminate/Pagination/LengthAwarePaginator.php 该目录增加 /** * Get the instance as an array. * * @return array */ public function asArray() { return [ 'data' => $this->items->toArray(), 'total' => $this->total(), ]; } 2.使用:分页后面加asArray 例:paginate(1)->asArray();
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交