Php Laravel LengthAwarePaginator where查询
我在变量Php Laravel LengthAwarePaginator where查询,php,laravel,Php,Laravel,我在变量dataTypeContent中使用了lengtasharepaginator,当我使用where时,他只在第一页进行查询。但我需要在所有页面上按where返回新的筛选项目 $dataTypeContent->where('category_id', 48); LengthAwarePaginator {#303 ▼ #total: 283 #lastPage: 19 #items: Collection {#1 ▶} #perPage: 15
dataTypeContent
中使用了lengtasharepaginator,当我使用where
时,他只在第一页进行查询。但我需要在所有页面上按where
返回新的筛选项目
$dataTypeContent->where('category_id', 48);
LengthAwarePaginator {#303 ▼
#total: 283
#lastPage: 19
#items: Collection {#1 ▶}
#perPage: 15
#currentPage: 1
#path: "/admin/products"
#query: []
#fragment: null
#pageName: "page"
}
更多代码:
如何在所有页面上执行
where
?我看到您的变量$dataTypeContent=$someQuery->paginate()代码>
您应该在paginate()之前使用where
<代码>$dataTypeContent=$someQuery->where()->paginate()代码>您能显示更多的代码吗。@ilubis done…您能更详细地说明哪种方法会给您带来麻烦吗?在分页之前,我不能使用where
。请看:你能给出你需要哪一行的详细信息吗?方法索引,第31行有$query
变量,你可以在这里链接你想要的任何东西,比如where