Welcome to the course! In this episode, we’re diving right into what cursor pagination is all about in Laravel and why it’s super handy, especially when building UIs with a “Load More” button.
We’ll start by looking at a Vue app that’s currently pulling paginated data from a Laravel API—a really common setup. You’ll see some sample (fake) data loaded in, and we’re showing 10 items per page. When we click “Load More”, the next batch of items appears as expected. But, if you add a new item (like posting something new in the UI) and then click “Load More”, you’ll notice a duplicate item shows up. That’s because classic pagination doesn’t handle new items well: it keeps its place by offset, not by the actual data.
The rest of the episode shows how simply switching to cursor pagination in Laravel completely fixes this issue. Now, when you add something new and load more items, you don’t get duplicates—just smooth, fast loading (no matter how big your dataset grows!).
Throughout the video, you’ll get a proper demo, see the issue with regular pagination, and then see how cursor pagination makes it all a breeze. Next up, we’ll set up everything from scratch and build it, so you can see exactly how it works in your own project.