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

Pagerfanta Laravel Package

nitra/pagerfanta

Laravel integration for the Pagerfanta pagination library. It bridges Eloquent and query builder results with Pagerfanta paginators, provides Blade-friendly rendering and configurable templates, and makes it easy to add consistent pagination to Laravel applications.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What the package is. nitra/pagerfanta is a fork of Pagerfanta — a framework-agnostic PHP pagination library built around two abstractions: an Adapter (wraps a data source such as a Doctrine query, an array, or a raw callable and answers getNbResults() / getSlice()) and a View (renders page links). The nitra fork is explicitly targeted at PHP 5.3, which reached end of life in August 2014. It is not a Laravel package in any meaningful sense: no service provider with auto-discovery, no facade, no Blade integration, no illuminate/support constraint, and no compatibility statement against any Laravel version.

Architecture fit — poor. Laravel ships Illuminate\Pagination in the core framework. It provides LengthAwarePaginator, Paginator, CursorPaginator, Blade rendering ($paginator->links()), JSON serialization for API resources, and query-string preservation — all first-party, all versioned in lockstep with the framework. Adopting Pagerfanta means introducing a parallel pagination abstraction alongside the native one, which is a net-negative for consistency and for any developer joining the team. The only defensible fit is a legacy application whose domain layer already speaks Pagerfanta\PagerfantaInterface and where a rewrite is out of scope.

Integration feasibility — low, and declining. Realistically workable only on the Laravel 4.x–5.1 era, PHP 5.3–5.6. On any modern stack the package will fail Composer resolution against current illuminate/* constraints, has no extra.laravel block for package discovery (Laravel 5.5+), and predates PSR-4/PSR-11 conventions that modern Laravel container wiring assumes. Any integration would require a hand-written service provider, manual binding of adapters, and a custom view layer — i.e. we would be writing the integration ourselves and owning it forever.

Package health signals — effectively zero. The scorecard reads: 0 stars, 0 dependents, a Bitbucket origin rather than Packagist/GitHub, and no visible release cadence. Zero dependents is the decisive datapoint: no other package in the ecosystem pulls this in, meaning there is no downstream testing, no bug reports, no incidental maintenance. A Bitbucket-hosted personal fork is also a single point of disappearance — no mirror, no guarantee the repository survives a hosting or account change. Treat availability as a risk to be mitigated, not assumed.

Technical risk.

  • Security: PHP 5.3 has an unpatched CVE surface spanning more than a decade. Pinning the runtime to satisfy this package is a far larger exposure than the package itself.
  • Upgrade deadlock: the package becomes the reason we cannot move to PHP 7/8 or a supported Laravel release, blocking every subsequent security and performance upgrade.
  • Correctness: pagination adapters that issue SELECT COUNT(*) across large tables are a classic performance trap; the fork inherits whatever the upstream did at that snapshot with no fixes since.
  • Licensing/provenance: verify the fork preserves the upstream MIT license and attribution before any redistribution or internal vendoring.

Key questions to resolve before any decision.

  1. What is the actual trigger — is there an existing codebase already depending on Pagerfanta, or is this being evaluated for new work? (If new work: reject outright.)
  2. Which PHP and Laravel versions must be supported at launch, and at +12 and +24 months?
  3. Does the requirement genuinely exceed Illuminate\Pagination, or is it a rendering/aesthetics need that a custom Blade view would satisfy?
  4. What is the dataset scale? If any paginated table exceeds ~1M rows or the query is expensive, offset pagination is the wrong primitive regardless of library, and cursor pagination should be the default.
  5. Who owns this code if the upstream disappears tomorrow? Is there an internal fork-and-maintain budget?

Recommendation: do not adopt. Approve only as a time-boxed containment measure inside a legacy application already using it, paired with an explicit decommission ticket.

Integration Approach

Stack fit. Greenfield or actively-maintained Laravel: no fit. Use Illuminate\Pagination — paginate() on the query builder or Eloquent, simplePaginate() where a total count is unnecessary, and cursorPaginate() where the dataset is large or the sort key is stable. This requires zero new dependencies, gets security patches with the framework, and is documented in the framework's own docs. The migration cost is measured in hours, not weeks, for typical controller/Blade usage.

Legacy-containment path (if the dependency already exists). Sequence it as a strangler, not a big-bang:

  1. Inventory — grep for Pagerfanta, PagerfantaInterface, and the view helper names; produce a call-site list with owning teams. Output: a count and a blast radius.
  2. Isolate — introduce a thin internal interface (e.g. App\Contracts\Paginator) at controller/Blade boundaries so call sites stop naming Pagerfanta types directly.
  3. Vendor-pin — if the Bitbucket repo is the only source, mirror it into internal VCS (or a private Composer repository / Satis) and pin an exact commit hash. Never depend on a live third-party URL for a build.
  4. Replace adapter-by-adapter — implement the internal interface over LengthAwarePaginator, migrate one surface at a time, and delete each Pagerfanta adapter as its last caller moves.
  5. Decommission — remove the dependency, the manual service provider registration, and the custom views in a single PR once call sites hit zero.

Compatibility work required if adopted as-is. A hand-rolled service provider registered in config/app.php (no auto-discovery); explicit require pins to prevent Composer from resolving a transitive illuminate/support that conflicts; a compatibility shim for any namespace or API drift between the fork and whatever Pagerfanta version the existing code expects; and a CI job that builds against the actual pinned PHP version so drift is caught at PR time rather than at deploy.

Sequencing against business commitments. Do not couple the replacement to a feature release. Ship the internal interface first (invisible to users), then migrate call sites behind it, then cut over. This keeps pagination behaviour stable across the transition and makes each step independently revertible.

Operational Impact

Maintenance. The package has no maintainer we can influence and no upstream we can file against. Every bug becomes an internal bug; every fix becomes an internal fork. Budget it as self-maintained code with no community, not as a dependency. Concretely: assume a fork-and-own cost, assign a named owner, and record it in the dependency register with a review date.

Support and knowledge. Zero dependents and zero stars means zero Stack Overflow corpus, zero blog posts, and no one to ask. Onboarding a new engineer to this code is entirely internal documentation — and that documentation only exists if we write it. Contrast with Illuminate\Pagination, where the answer to almost any question is one search away.

Scaling. Pagination logic itself is not the bottleneck; the query pattern is. Offset pagination implies a COUNT(*) and a deep OFFSET scan, both of which degrade non-linearly on large tables and are the most likely production symptom to surface as the product grows. Where pagination touches the largest tables, the correct answer is keyset/cursor pagination — available natively — rather than optimising around a 2012-era adapter.

Failure modes to plan for.

  • Repository disappearance — Bitbucket project deleted or moved; CI builds fail without warning. Mitigation: internal mirror + commit pin (do this on day one if the dependency is retained).
  • Runtime pinning — the PHP 5.3 requirement blocks framework upgrades; the failure is silent until someone attempts a composer update and hits a wall. Mitigation: explicit upgrade-blocker ticket with a target date.
  • Abstraction drift — two pagination APIs coexisting; new code picks the wrong one. Mitigation: a static-analysis or linter rule banning new imports of the legacy namespace.
  • Security exposure — unsupported PHP runtime serving production traffic. This is the highest-severity item and outranks the pagination question entirely.
  • Rendering drift — a hand-rolled view layer diverges from framework pagination semantics (query-string handling, page-name collisions, edge cases at page 1 and last page). Mitigation: shared Blade component so both paths render identically.

Ramp-up. For a developer already fluent in Pagerfanta, the API is small and learnable in under a day. The real ramp-up cost is not the library — it is reconstructing why the fork exists, which fixes it carries, and what the original author intended. That context is almost certainly not written down. For Illuminate\Pagination, ramp-up is near-zero for anyone with Laravel experience, which is the dominant practical argument in its favour.

Bottom line for the roadmap. This package should appear on the technical-debt register, not the platform roadmap. The decision to make is not "how do we integrate it" but "what is the date by which it is removed," and the answer should be driven by the PHP runtime upgrade timeline rather than by pagination requirements.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
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