spiral/pagination
Spiral Pagination Toolkit provides lightweight, framework-agnostic pagination primitives for PHP apps. Build and pass around page limits/offsets and related metadata cleanly, with strong type safety, tests, and Psalm support.
data, meta.pagination) across REST/GraphQL APIs, reducing frontend integration friction.edges, pageInfo) or cursor-based APIs for scalable client-side rendering.Adopt if:
Illuminate\Pagination bloat.Look elsewhere if:
lengthAwarePaginator, query builder integration).spatie/laravel-pagination (active, Laravel-focused).Illuminate\Pagination.For Executives: "This package standardizes pagination across our Laravel apps—reducing inconsistency in APIs, admin tools, and microservices. By decoupling pagination from databases, we can reuse logic for non-DB data (e.g., APIs, files) and improve API client experiences. It’s a lightweight, MIT-licensed solution that aligns with our API-first roadmap and cuts dev time for pagination-heavy features. Trade-off: Last updated in 2019, so we’d need to validate PHP 8.1+ compatibility."
For Engineering:
"The spiral/pagination package provides PSR-compliant interfaces for offset/cursor/key-based pagination, letting us standardize responses across APIs, admin panels, and services. It’s ideal if we want to avoid Laravel’s Eloquent pagination or need pagination for non-database data.
Trade-offs:
spatie/laravel-pagination."*For Developers:
"This gives us pagination interfaces (PageInterface, PaginatorInterface) to enforce consistency. Example: Implement PageInterface for a custom ApiPaginator to standardize API responses. Trade-off: No built-in Laravel support—you’ll need to write adapters (e.g., for LengthAwarePaginator). Start with a pilot in a non-critical API endpoint."
How can I help you explore Laravel packages today?