Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cursor Pagination Laravel Package

juampi92/cursor-pagination

Cursor-based pagination for Laravel Eloquent, inspired by Stripe. Encode and decode opaque cursors with ease, keeping pagination stable and efficient. Perfect for large datasets, infinite scrolling, and APIs that need predictable next/previous navigation.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API pagination strategy (offset vs. cursor): Informs whether an endpoint should expose page-number pagination or opaque cursors. Cursor pagination is the right call for large, append-heavy, or frequently-changing datasets (feeds, activity logs, transactions, notifications) where offset pagination causes duplicated/skipped rows and degrades at depth.
  • Performance and cost trade-offs at scale: Cursor pagination avoids OFFSET scans, which materially reduces query time and database load on high-volume endpoints. This is a lever for infrastructure cost and latency SLOs, not just developer ergonomics.
  • Client UX decisions: Supports infinite scroll, "load more," and mobile-first list experiences, and defines the contract mobile/web clients must honor (opaque cursor, no random page access, no total count).
  • Build vs. buy vs. use-the-framework: The core decision this package informs is whether to hand-roll cursor logic, adopt a third-party package, or use Laravel's native implementation. Given the package is archived (last release 2020-11-24) and Laravel shipped native cursorPaginate() around the same period, the honest conclusion is usually "use the framework."
  • Dependency risk and roadmap hygiene: Serves as an input to technical-debt and supply-chain reviews — an archived, unmaintained dependency in a customer-facing API is a standing risk that needs an owner and an exit plan.

When to Consider This Package

Consider it only in narrow, time-boxed situations:

  • You are on a legacy Laravel version (pre-8.x) that predates native cursor pagination and cannot upgrade on your current roadmap.
  • You need cursor semantics quickly for a single internal or low-traffic endpoint and accept the maintenance burden as explicitly temporary.
  • You want a reference implementation to study cursor encoding/decoding, boundary handling, and paginator contracts before building or adopting the native equivalent.

Look elsewhere (i.e., use Laravel's native cursorPaginate()) when:

  • You are on Laravel 8+ — the framework already provides cursor pagination, is maintained, and is covered by the framework's security and upgrade path. Adopting a 2020-era archived package here is strictly worse.
  • You need ongoing security patches, PHP/Laravel version compatibility, or vendor support. "Archived" means no fixes for new framework versions or disclosed issues.
  • Your endpoints require complex multi-column ordering, filtered cursors, or stable ordering guarantees — verify the package's semantics against your needs rather than assuming parity with native behavior.
  • You need total counts or random page access — cursor pagination is the wrong tool regardless of library, and the package does not change that.

Adoption gate: Treat this as a stopgap with a written exit criterion (e.g., "removed upon Laravel upgrade to X"). Without that, the answer is no.

How to Pitch It (Stakeholders)

For executives: This is a small, MIT-licensed library for API pagination — a technical implementation detail, not a product differentiator. The strategic takeaway is that we probably shouldn't adopt it: it has been archived since 2020 and Laravel now ships equivalent functionality for free. Choosing the framework's built-in path reduces maintenance cost and supply-chain risk at no loss of capability. The only scenario where it enters our stack is as a short-lived bridge for legacy services, with a scheduled removal.

For engineering: Cursor pagination is the correct pattern for large or fast-changing collections; it eliminates OFFSET cost and the duplicate/skip artifacts of offset pagination. This package was a reasonable solution in its era, but it is unmaintained and predates Laravel's native cursorPaginate(). Recommendation: use the native implementation for new work, and if this package is already in the codebase, scope a migration as part of the next Laravel upgrade rather than treating it as a permanent dependency. If adopted as a stopgap, document the exit condition and owner in the same PR.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator