Is it possible to paginate collection data?
See original GitHub issueI’ve set up some collections, and have indices which I’d like to paginate over the resulting data. I was expecting to be able to use the following template:
---
layout: layouts/default
title: 'Journal'
pagination:
data: collections.posts
size: 8
permalink: '/journal/page/{{ pagination.pageNumber }}.html'
---
{% for item in pagination.items %}
{% include "item/post" %}
{% endfor %}
I might have misunderstood this feature, but is it possible to use collection data as a basis for pagination?
Issue Analytics
- State:
- Created 6 years ago
- Comments:17 (13 by maintainers)
Top Results From Across the Web
How can i paginate laravel collection? - Stack Overflow
It is because paginate is Builder method, not collection. You need to create paginator manually, how described here ...
Read more >Database: Pagination - The PHP Framework For Web Artisans
The paginate method counts the total number of records matched by the query before retrieving the records from the database. This is done...
Read more >Laravel: How to Paginate Collection | by Sam Ngu | Medium
Laravel supports eloquent model pagination out of the box, but not custom collection. This quick tutorial will show you an easy way to...
Read more >Paginate data with query cursors | Firestore | Firebase - Google
Paginate queries by combining query cursors with the limit() method. For example, use the last document in a batch as the start of...
Read more >get data from Pagination - Laravel.io
You can access data object via array index. {{ $users[0]->name }}. but why? Last updated 7 months ago ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
hey I am still struggling to make paged paginations. Is there an example repo or an output of what this code does? I tried it but it doesn’t do what I thought it would. Thanks!
And it already is. Sigh. Stupid me not CTRL+F on the page. Sorry for the noise!