symfony-twig/pager-bundle
symfony-twig/pager-bundle is a Symfony bundle for adding Twig-powered pagination to your projects. It provides reusable pager rendering and page navigation controls, helping you display paginated lists with configurable ranges and simple template integration.
Architecture fit — disqualified for a Laravel codebase. The package is a Symfony bundle (type symfony-bundle), not a Laravel package. It depends on Symfony's HTTP kernel, bundle registration (bundles.php / AppKernel), the Symfony service container, and Twig as the view layer. Laravel has no bundle system, uses Blade by default, and its service-provider lifecycle — while conceptually analogous — is not binary-compatible. Even in a Symfony context the fit is weak: Symfony ships Pagerfanta, KnpPaginatorBundle, and its own Paginator, all more maintained and adopted. The catalog classification as a "Laravel/PHP package" is a metadata error a TPM should flag on day one.
Integration feasibility — low to non-existent for Laravel. Forcing this into a Laravel app would require adding twig/twig plus a Twig bridge, shimming Symfony bundle/config loading into a service provider, writing an adapter that feeds Eloquent/query-builder results into the package's pager abstraction, and re-rendering the UI in Blade (or committing to Twig for a subset of views). That is a rewrite of a few hundred lines of commodity logic at strictly higher cost than building directly on LengthAwarePaginator, which already handles ?page= parsing, query-string preservation, and links() rendering.
Technical risk — high.
Key questions a TPM must resolve before any further investment:
LengthAwarePaginator (Laravel) or Pagerfanta (Symfony)? If none, there is no problem.GROUP BY, HAVING, DISTINCT correctly, or assume single-table counts?composer.json declare, and do they intersect our supported matrix?Stack fit — not viable for Laravel. There is no path where a Symfony bundle is a dependency of a Laravel app without an adapter layer we own and maintain indefinitely. The honest classification: candidate for a Symfony ≥3 legacy app, disqualified for a Laravel codebase.
Migration path. There is nothing to migrate from; the recommended path is the inverse — do not introduce it, and if a legacy Symfony service already uses it, plan an exit:
LengthAwarePaginator (Laravel).PaginatorInterface (paginate(Query, int $perPage): PageResult) so the vendor call site is one adapter class, not scattered across controllers and templates.items, total, perPage, currentPage) and let each stack render its own links — this makes eventual swap a single-file change and removes the Twig dependency from the blast radius.Compatibility. Verify composer.json constraints against our PHP matrix and Twig major version before writing code. Expect friction on PHP 8.1+ (implicit nullable params, dynamic properties) and Twig 3 (deprecated spaceless, changed escaping defaults). Symfony 3's EOL means Composer security-advisory checks will flag it and long-term support is unavailable.
Sequencing (if a spike is approved despite the above):
Maintenance — you inherit it. With 0 dependents and a single maintainer on an EOL framework major, the realistic planning assumption is that upstream receives no further releases. Any adoption is effectively a permanent fork: we patch PHP 8.x deprecations, Twig API changes, and any counting bug ourselves. Estimate a few days per year of unplanned work plus the compounding cost of a blocked framework upgrade.
Support — none. No vendor, no community forum, no Stack Overflow corpus. On-call engineers debugging a pagination defect read source directly with no upstream escalation path. That is a poor use of senior engineering time for a commodity feature.
Scaling — neutral to negative. The bundle governs presentation, not data access, so it contributes nothing to scale. Real scaling risks live below it: COUNT(*) over large/joined result sets, deep OFFSET scans on high page numbers, and unbounded perPage values. None are addressed by the package; all need an explicit internal standard (capped page size, keyset pagination for large tables, cached/approximate counts).
Failure modes to plan for:
GROUP BY/HAVING/DISTINCT produce duplicated or skipped rows across pages. Users notice before monitoring does.Ramp-up. A Symfony developer: an afternoon — the API is conventional. A Laravel team: negative value. Engineers would learn a framework they do not otherwise use, in service of a feature Laravel already provides, in a skill discarded at the first refactor. Onboarding cost is not the constraint; the constraint is that the learning is non-transferable.
Recommendation. Do not adopt. This is a commodity feature wrapped in a framework-specific, effectively unmaintained, zero-adoption bundle that is architecturally incompatible with Laravel and redundant within Symfony. Close the ticket with a written pagination standard instead — cursor pagination for high-volume endpoints, a capped perPage, and Laravel's native paginator or Pagerfanta as the sanctioned implementation. Revisit only if a concrete, unmet requirement emerges that framework-native tooling provably cannot satisfy.
How can I help you explore Laravel packages today?