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
Laravel Cursor Paginator

Laravel Cursor Paginator Laravel Package

amrnn/laravel-cursor-paginator

Cursor-based pagination for Laravel. amrnn/laravel-cursor-paginator provides a paginator that uses cursors instead of offsets, useful for APIs and large datasets where stable, efficient paging matters. A small, focused package for Eloquent queries.

View on GitHub
Deep Wiki
Context7

Cursor pagination for Laravel

Frequently asked questions about Laravel Cursor Paginator
What is amrnn/laravel-cursor-paginator used for?
It provides cursor-based pagination for Laravel query builder and Eloquent queries. Instead of LIMIT/OFFSET, it uses the last row's sort position to fetch the next page, which is useful for APIs and large datasets where stable, efficient paging matters. It is a small, focused package, but it predates Laravel's own cursor pagination support.
Does amrnn/laravel-cursor-paginator support Laravel 8, 9, 10, and 11?
The package was built before Laravel 8 introduced native cursorPaginate, and the repository is archived, so current Laravel and PHP compatibility is not guaranteed. It is only meaningfully additive on Laravel 7 or earlier, which is end-of-life. For Laravel 8 and newer, use the framework's built-in cursor paginator instead.
How do I install amrnn/laravel-cursor-paginator?
You would install it with Composer using composer require amrnn/laravel-cursor-paginator, then wire in the package's paginator or trait as described in its README. Before doing that, confirm the package supports your PHP and Laravel versions. Because the repository is archived, installation on a modern Laravel app is not recommended; native cursorPaginate is already available.
Is amrnn/laravel-cursor-paginator still maintained?
No. The repository is archived, which means the code is frozen and there are no ongoing bug fixes, security advisories, or PHP and Laravel compatibility updates. With a single maintainer and very low community adoption, you should treat it as abandoned. If you already depend on it, plan a migration rather than expecting patches.
What is the difference between amrnn/laravel-cursor-paginator and Laravel's cursorPaginate?
Both implement keyset pagination, encoding the last row's sort position into a cursor instead of using an offset. Laravel 8 shipped a first-party CursorPaginator with cursor and per_page request parameters and next_cursor and prev_cursor in the JSON payload. This package duplicates that framework primitive, with a different cursor format and response contract, so migrating later adds cost.
Can I use amrnn/laravel-cursor-paginator for APIs and large datasets?
Cursor pagination is a good fit for APIs and large tables because it avoids deep OFFSET scans and remains stable under concurrent inserts. This package implements that pattern, but Laravel 8 and later already provide it natively. For a modern app, using the built-in cursorPaginate is the safer choice because it is maintained with the framework.
What are the risks of using amrnn/laravel-cursor-paginator in production?
The main risk is abandonment: archived code will not receive fixes for future Laravel or PHP incompatibilities, so any breakage becomes your fork to maintain. There is also namespace collision risk because the package's CursorPaginator and cursorPaginate can overlap with Laravel's own symbols. Cursor correctness depends on deterministic, unique ORDER BY columns, and older third-party implementations may handle composite or mixed-direction ordering less rigorously.
How do I migrate from amrnn/laravel-cursor-paginator to Laravel's native cursor pagination?
Inventory composer.json, composer.lock, service providers, traits, and every endpoint using the package's paginator. Replace the call with native cursorPaginate($perPage, ['*'], 'cursor', $cursor), make the ordering explicit with at least one order column, and verify composite indexes on every sort key. Then normalize the response to data, per_page, next_cursor, and prev_cursor, update API docs and clients, and remove the dependency and any orphaned provider entries.
Does cursor pagination require unique or indexed sort columns?
Yes, cursor pagination is only correct when the ORDER BY is deterministic and unique. Non-unique or NULL-bearing sort columns can silently skip or duplicate rows, so use a unique tie-breaker such as id. Every cursor sort column should also be backed by an appropriate index, ideally a composite index matching the ordering.
What are the best alternatives to amrnn/laravel-cursor-paginator?
For Laravel 8 and newer, the best alternative is Laravel's built-in cursorPaginate on the query builder and Eloquent, which includes the official CursorPaginator class and standard cursor response fields. If you need custom opaque or encrypted cursors, build that on top of the native paginator rather than adopting an archived third-party package. For Laravel 7 or earlier, the real alternative is upgrading the framework, since that version is end-of-life.
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.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin