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

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

A lightweight, framework-agnostic pagination library for PHP from Paysera. It turns request parameters into safe limit/offset values, calculates total pages, and exposes metadata for building paginated APIs or UI controls. Composer-ready and compatible with PDO, Doctrine, or custom data sources.

  • Simple page and page-size configuration
  • Calculates offset, total pages, and navigation metadata
  • Handles out-of-range pages and custom limits
  • Dependency-light, easy Composer integration
  • Suitable for REST APIs and server-rendered lists
Frequently asked questions about Lib Pagination
Does paysera/lib-pagination work with Laravel's Eloquent ORM?
No. The package paginates Doctrine's QueryBuilder, not Eloquent's query builder, so an Eloquent-first Laravel application cannot use it without switching ORMs. Laravel already ships paginate() and cursorPaginate() for Eloquent, which cover the same offset and cursor use cases. Only adopt this package if your application already runs Doctrine through a bridge such as laravel-doctrine/orm.
How do I install paysera/lib-pagination with Composer?
Install it with composer require paysera/lib-pagination. The description does not indicate any Laravel package auto-discovery, so expect to instantiate the paginator manually rather than relying on a service provider. Before installing, confirm the package's PHP, doctrine/orm, and doctrine/dbal constraints, since the canonical repository metadata is not verifiable from the listing.
What is the difference between cursor-based and offset-based pagination in this package?
Offset pagination uses page numbers and offsets, which supports random access and total-page metadata but requires a COUNT query and drifts when rows are inserted or deleted mid-scroll. Cursor pagination walks the result set from a stable sort key, which stays fast and consistent on deep pages but does not support jumping to an arbitrary page. The two modes produce different response envelopes, so do not switch modes silently on a client-facing endpoint.
Which Doctrine ORM and DBAL versions does paysera/lib-pagination support?
The supported versions cannot be confirmed from the available listing because the repository is marked unknown, so the composer.json constraints are unverified. Check the actual composer.json for the PHP floor, the doctrine/orm major version (including whether ORM 3.x is supported), and DBAL driver coverage before committing. This is a pre-integration gate, not a formality, especially if you run ORM 3.x.
Do I need a Laravel service provider or config file to use this package?
The package description implies no framework coupling, and no service provider or config publishing is mentioned. Plan on manual wiring: construct the paginator in your own service layer, pass it the Doctrine QueryBuilder, and return your own response structure. A thin Laravel adapter or wrapper interface keeps the dependency swappable and out of controllers.
Is paysera/lib-pagination suitable for large tables and deep pagination?
Cursor-based pagination is the right primitive for large, deep result sets because it avoids growing OFFSET costs and repeated COUNT queries. Offset mode is better suited to admin screens where users need page numbers and total counts. Run a spike against a realistic table with a composite sort key on your actual database engine and measure deep-page latency before committing.
How does the package handle composite or nullable sort keys?
The available description does not document composite or nullable sort-key behavior, and cursor pagination is only correct with deterministic, unique tie-breaking. Ensure your sort includes a unique column such as the primary key as a final tie-breaker, and test NULL ordering explicitly on MySQL and PostgreSQL. If behavior is undocumented, add integration tests that lock it down before relying on it.
Can I use paysera/lib-pagination in a Laravel app that already uses laravel-doctrine/orm?
Yes, that is the only Laravel context where the package fits, since laravel-doctrine/orm gives you the Doctrine QueryBuilder it targets. Wrap the library behind your own paginator interface so controllers and repositories never call it directly, and keep the dependency replaceable. This keeps the integration bounded if maintenance or compatibility issues appear later.
What are the alternatives to paysera/lib-pagination in Laravel?
For Eloquent, Laravel's built-in paginate() and cursorPaginate() cover offset and cursor pagination without any extra dependency. For Doctrine, alternatives include Pagerfanta and Doctrine's own paginator, both of which have wider adoption and more third-party hardening. This package is best recorded as a monitor-and-evaluate option unless you are already committed to Doctrine and need its dual-mode API.
Is paysera/lib-pagination actively maintained and safe for production use?
Signals are thin: roughly 14 stars, a single corporate publisher, and an unlinkable repository with an anomalous future-dated release that must be reconciled before adoption. Cursor pagination is deceptively hard, and low-adoption libraries rarely carry the adversarial test coverage that sort-key stability and cursor invalidation demand. It may be acceptable for internal, bounded use behind an adapter, but resolve provenance and read the source before merging the dependency.
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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core