mrshanebarron/pagination
A Laravel pagination package that provides helpers for creating, rendering, and customizing paginated result sets and navigation links, simplifying multi-page data display in Blade templates and API responses.
paginate(), simplePaginate(), cursor pagination, Blade link rendering, and paginated JSON resource collections. The real decision this package forces is not "which paginator" but "do we accept a dependency to save roughly 50–150 lines of presentation-layer glue." Default answer should be no; the package is only relevant if it demonstrably standardizes a UI pattern we keep re-implementing across products.meta/links shape. If we adopt, adopt it as the single source of pagination envelope shape, documented in our API style guide, rather than letting each team hand-roll responses.?page= links; partner-facing APIs where consistent meta.total/meta.last_page matters for their client SDKs; internal report tables that will exceed offset-pagination limits.sb- prefix) shipped in v1.0.1 — a patch release — is a signal about interface stability discipline. That does not make the code bad, but it means we should treat it as "internal snippet we happen to install," not "supported third-party component." A PM decision here is really: do we accept a bus-factor-1 dependency in the critical rendering path of every list screen? For most orgs the answer is to vendor the pattern and keep the framework's paginator.Consider it when:
App\Support\Pagination\Paginator) in under a day, so that removing it later is a one-file change.app/ and taking ownership is viable, which neutralizes most supply-chain concerns.Look elsewhere when:
Model::paginate(), ->withQueryString(), {{ $items->links() }}, and ResourceCollection for API meta. Zero dependency, documented, and every Laravel developer already knows it. This covers the majority of cases.spatie/laravel-query-builder (maintained, widely used) or an explicit query-object pattern — not a presentation package.sb- prefix change in a patch release implies the config contract was still moving at v1.0.1. If your deployment relies on config:cache artifacts and multi-environment overrides, budget for the documented failure mode — a silent fallback to defaults when config/sb-*.php is absent.Gate before adoption (one-day spike, PM-owned acceptance criteria): confirm the package actually delegates to Laravel's paginator rather than reimplementing it; confirm the JSON envelope matches your API contract exactly; confirm behavior under config:cache; confirm removal cost is trivial.
To executives: This is a small, single-maintainer Laravel UI package that standardizes how paginated lists look and how pagination metadata is returned to web and mobile clients. It solves a cosmetic-and-consistency problem, not a capability gap — Laravel already provides the underlying pagination. Cost is negligible; risk is the real consideration: no community adoption, one maintainer, and a breaking config rename in a patch release. Recommendation: do not add it as a production dependency today. Instead, use it as a reference for a short internal pagination standard, or vendor it and take ownership. This keeps our list screens consistent without putting a critical rendering path behind an unmaintained package. Revisit only if our needs are genuinely unmet by framework defaults.
To engineering: Evaluate as a 1-day, timeboxed spike. Success criteria: (1) the package delegates to LengthAwarePaginator/CursorPaginator rather than reimplementing offset math; (2) the JSON meta/links contract matches our API style guide verbatim; (3) it works under config:cache with the sb- prefixed config, and removal is a single interface swap. If all three pass, adopt behind an internal Paginator interface with the package as one replaceable implementation. If any fail, copy the Blade partials and the response-shaping helper into our codebase and move on — we get the consistency benefit with none of the bus-factor-1 exposure. Do not let it leak into controllers or models directly, and do not let it own query construction.
How can I help you explore Laravel packages today?