【发布时间】:2017-08-02 00:14:29
【问题描述】:
这是dd($followers)的结果:
LengthAwarePaginator {#401 ▼
#total: 144
#lastPage: 8
#items: Collection {#402 ▼
#items: array:18 [▶]
}
#perPage: 20
#currentPage: 1
#path: "http://myurl.com/SocialCenter/public/twitterprofile/JZarif"
#query: []
#fragment: null
#pageName: "page"
}
现在我想知道,如何覆盖#total?我的意思是我想将它重新初始化为18。所以这是预期的结果:
LengthAwarePaginator {#401 ▼
#total: 18
#lastPage: 8
#items: Collection {#402 ▼
#items: array:18 [▶]
}
#perPage: 20
#currentPage: 1
#path: "http://myurl.com/SocialCenter/public/twitterprofile/JZarif"
#query: []
#fragment: null
#pageName: "page"
}
这样可以吗?
注意到这些都不起作用:
$followers->total = 18;
$followers['total'] = 18;
【问题讨论】:
-
为什么会从144变成18?你真正想做什么?
-
@Ohgodwhy 我正在尝试做this