Replies: 1 comment 1 reply
-
You code is missing the $posts = Product::published()
->where('category_id', $categoryId)
->paginate(12, post('page')); Also please specify what "does not work" means exactly (what error? what wrong behaviour?), if the code above does not fix your problem. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! How to filter products to show only products for the category and used product filters for pagination:
$posts = Product::published()->paginate(12, post('page')); - works, but not filtered
$posts = Product::published()->('category_id', $categoryId)->paginate(12, post('page')); - does not work
Beta Was this translation helpful? Give feedback.
All reactions