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

Lib Pagination Laravel Package

paysera/lib-pagination

A lightweight PHP pagination library from Paysera for splitting data sets into pages. It calculates offsets, page counts, and navigation ranges, helping developers build paginated lists and search results in web applications.

Deep Wiki
Context7

Technical Evaluation

Architecture fit. The package targets Doctrine's QueryBuilder, not Eloquent. A standard Laravel application—which ships with Eloquent as the default ORM—gains nothing unless it already runs Doctrine through a bridge such as laravel-doctrine/orm. In that narrower context the fit is reasonable: cursor-based pagination is the correct primitive for large, deep result sets, and offset-based fallback covers admin-style screens where random access matters. The dual-mode API is a plus, but it also means the library's value is concentrated in the cursor path, which is exactly the path Laravel's own cursorPaginate() already covers for Eloquent users.

Integration feasibility. Composer-installable, MIT-licensed, no framework coupling implied by the description. Absent a service provider, expect manual wiring or a thin Laravel adapter of your own. The blocking unknown is packaging metadata: the repository is listed as unknown, which prevents verifying composer.json constraints, PHP version floor, Doctrine ORM/DBAL compatibility, and test coverage. That is a pre-integration gate, not a detail.

Technical risk. Three concerns, in order: (1) Provenance—an unlinkable repository with a future-dated "last release" (2026-09-29) is a metadata anomaly that must be resolved before any dependency is merged; (2) Bus factor—14 stars and a single corporate publisher imply a small maintainer pool and near-zero third-party hardening; (3) Correctness surface—cursor pagination is deceptively hard (stable sort keys, tie-breaking, cursor invalidation on mutation), and low-adoption libraries in this space rarely have the adversarial test coverage that the failure modes demand. None of these are disqualifying for internal, bounded use; all are disqualifying for silent adoption.

Key questions.

  • Where is the canonical repository, and can the 2026-09-29 release be reconciled with a real commit/tag history?
  • What are the exact php, doctrine/orm, and doctrine/dbal constraints, and is ORM 3.x supported?
  • How is the cursor encoded—opaque base64 of sort values, or signed/encrypted? Does it validate sort-key stability client-side?
  • What is the test matrix, and are there integration tests against MySQL and PostgreSQL?
  • Is the package maintained for Paysera's internal use with public spillover, or is it explicitly supported?
  • Does it handle composite and nullable sort keys deterministically?

Integration Approach

Stack fit. Adopt only in a Laravel stack already committed to Doctrine. For Eloquent-first applications, the correct answer is Laravel's native cursorPaginate()/paginate(), and this package should be recorded as "monitor," not "integrate." For Doctrine-backed services—including non-Laravel PHP services—the fit improves materially and the evaluation should proceed.

Migration path. Do not migrate an application's ORM to use this library. The viable path is the inverse: where Doctrine is already present, replace hand-rolled pagination helpers with this package behind your own PaginatorInterface so the dependency stays swappable. If a team is on Eloquent and needs cursor pagination, the migration is to native Laravel features, not to this package.

Compatibility. Verify before committing: PHP floor against your runtime, Doctrine ORM major version, DBAL driver coverage, and whether cursor pagination emits portable DQL or driver-specific SQL. Note that offset pagination semantics (COUNT(*) per request, page-number drift) differ from cursor semantics, so any endpoint exposed to clients must not silently switch modes—the response envelope and client contract differ.

Sequencing.

  1. Resolve provenance and read the source; timebox to half a day.
  2. Run a spike against a realistic table (≥10M rows, composite sort key) on your actual database engine; measure deep-page latency versus offset.
  3. Wrap the library in an internal adapter interface; no direct calls from controllers or repositories.
  4. Roll out cursor pagination to one high-volume read endpoint only; keep offset pagination on admin and export surfaces.
  5. Pin the exact version in composer.json and record the fork point in your dependency register.

Decision gate. Treat this as a conditional approve for Doctrine shops and a reject for Eloquent shops. The opportunity score (1.33) and overall score (20.27) are consistent with a library that is functional but not a strategic dependency.

Operational Impact

Maintenance. Assume you own it. A 14-star package with one publisher will not track your PHP and Doctrine upgrade cadence, and Doctrine major-version bumps are exactly where small pagination libraries break. Budget for a maintained fork or an internal patch set, and keep the adapter thin enough that replacing the library is a contained change. Pin versions; do not float constraints.

Support. No SLA, no vendor escalation path, community-only issue triage. Appropriate for internal tooling and batch/reporting paths; inappropriate for a customer-facing contract with uptime commitments unless you have independently validated and can patch it.

Scaling. This is the package's strongest argument. Cursor pagination keeps deep-page query cost roughly flat, where offset pagination degrades linearly with page depth. Realizing that benefit requires correct composite indexes matching the sort key order and a tie-breaker column in the cursor—otherwise the database does a sort and the advantage evaporates. Validate with EXPLAIN on production-shaped data, not on fixtures.

Failure modes.

  • Cursor drift: rows inserted or deleted between pages cause skips or duplicates if the sort key is non-unique or mutable.
  • Invalidated cursors: sort-key changes or schema migrations silently break outstanding cursors held by clients; define an expiry and a 400 response contract.
  • Encoding defects: malformed or tampered cursors must fail closed, not produce unbounded queries.
  • Offset-mode misuse: exposing offset pagination on large tables reintroduces the deep-page cost the library was chosen to avoid.
  • Portability gaps: driver-specific SQL may pass on MySQL and fail on PostgreSQL; test on the engine you deploy.
  • Abandonment: an unpatched dependency on the read path of a high-traffic endpoint is an availability risk, not just a hygiene issue.

Ramp-up. Low for engineers fluent in Doctrine's QueryBuilder and cursor pagination concepts—perhaps half a day to first productive use. Higher for Eloquent-native teams, where the cost is not the library but Doctrine itself; that cost is rarely justified by pagination alone. Document the cursor contract (sort key, tie-breaker, expiry, error semantics) in your API spec before the first endpoint ships, since the client-visible behavior is the part that is expensive to change later.

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.
mydnic/volet-feature-board-filament-plugin
wmde/email-address
refinery29/test-util
dees040/laravel-api-responses
teamzac/geocoder
ideatica/config-writer
keaton-php/pipe-dream
jacksonwebservices/laravel-user-suite
maksimru/conditional-laravel-debugbar
gismatul/nova-support-chat
gismatul/laravel-support-chat
networkrailbusinesssystems/oracle-api
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
refinery29/php-cs-fixer-config
parsnick/steak