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.
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.
php, doctrine/orm, and doctrine/dbal constraints, and is ORM 3.x supported?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.
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.
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.
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.
How can I help you explore Laravel packages today?