javihgil/doctrine-pagination-bundle
A Symfony bundle that adds simple pagination for Doctrine queries, helping you split ORM and DBAL results into pages with a reusable paginator service. Ideal for building paged listings, search results, and admin grids without writing custom limit/offset logic.
Architecture fit — fundamental mismatch. Despite being filed as a Laravel/PHP package, this is a Symfony bundle. Its entire delivery mechanism is Symfony-specific: a Bundle subclass registered via config/bundles.php, a DependencyInjection\Extension with a configuration tree, and service definitions loaded from YAML/XML. Laravel has no bundle, compiler-pass, or DI-extension concept, and Composer package discovery (extra.laravel.providers) will find nothing to register. The package will install into a Laravel app (Composer does not care) but none of its services will ever be wired, producing class-not-found errors at first use. Even the underlying doctrine/dbal presence in Laravel (used for schema operations) does not help — that is DBAL, not ORM bundle infrastructure.
Value proposition overlap. The core function is nearly redundant in both ecosystems:
Doctrine\ORM\Tools\Paginator with HINT_ENABLE_DISTINCT.LengthAwarePaginator, CursorPaginator, and a query-builder paginator.The bundle's only plausible differentiator is ergonomics: request ?page=/?limit= parsing into a paginated result value object, and possibly a Twig helper. That is roughly 100–150 lines of code, not a dependency.
Integration feasibility.
| Target runtime | Feasibility | Effort |
|---|---|---|
| Symfony 3.4–5.x + Doctrine ORM 2.x | Drop-in, minutes | Trivial |
| Laravel 10/11 + PHP 8.2/8.3 | Not feasible as-is; port required | 1–2 engineer-days + tests written from scratch |
| Symfony 6/7 + Doctrine ORM 3.x | Likely blocked by constraints | Needs a fork |
Technical risk. This package carries an unusually clean negative signal: 0 stars, 0 dependents, last release 2022-12-20, score 0. Zero dependents means no field validation of correctness or edge cases anywhere in the wild — we would be the only production consumer. The intrinsic attack surface is low (no auth, crypto, or deserialization), but an unmaintained transitive dependency is still unpatchable by definition. The realistic risks are dependency-resolution lock-in (pinning us below a PHP/Symfony/Doctrine upgrade) and silent correctness bugs in COUNT handling.
Key questions (one is blocking).
composer.json constraints for php, symfony/*, and doctrine/orm, and do they resolve against our target matrix?Doctrine\ORM\Tools\Paginator plus Laravel's LengthAwarePaginator do not already provide?BabDevPagerfanta, KnpPaginatorBundle, or a first-party adapter) with a real release cadence?Stack fit. Poor for the stated stack. If the real destination is a Symfony application, fit is good but the package competes with actively maintained paginators that have Symfony 6/7 and Doctrine ORM 3 support. If the destination is Laravel, fit is effectively zero without a fork.
Migration path. Do not migrate to this package; migrate past it.
doctrine/orm (optionally laravel-doctrine/orm), wrap Doctrine\ORM\Tools\Paginator, and adapt to LengthAwarePaginator via AbstractPaginator::resolveCurrentPage(). Small, testable, ours.Compatibility. Assume the constraints target PHP 7.x–8.0, Symfony ≤5, and Doctrine ORM ≤2.14. Doctrine ORM 3.0 (2024) changed paginator and query-building APIs; expect this package to fail resolution. Verify with composer why-not before any spike.
Sequencing.
composer require against a throwaway skeleton at our target PHP version; record the exact conflict output. This is cheaper than reading the source.BabDevPagerfanta; if Laravel, close the ticket as "not applicable" and open an in-house adapter task.DISTINCT, deterministic ordering, and empty-result pages.Maintenance. No release cadence since December 2022, no evidence of an active maintainer, and likely no CI-backed test suite. Adopting it converts a dependency into an owned asset: assume ~15–25% of one backend engineer's year in the first twelve months, almost entirely dependency bumps and compatibility shims.
Support. GitHub issues only — no SLA, no commercial backing, no vendor to escalate to. Institutional knowledge will be one engineer who has read a few hundred lines of PHP.
Scaling. Offset/limit pagination is inherently O(offset) in the database. The COUNT(*) query is the usual bottleneck on large or heavily joined datasets, and HINT_ENABLE_DISTINCT can force temp tables on MySQL/Postgres. Below ~100k rows this is invisible; above ~1M rows expect p95 latency cliffs regardless of which paginator we choose. Memory is bounded by page size and is safe. The scaling answer is cursor/keyset pagination on our largest tables — a decision this package cannot make for us.
Failure modes.
ClassNotFoundError in production.COUNT; pagination UI shows wrong page counts and tests won't catch it without deliberate fixtures.ORDER BY combined with OFFSET skips or repeats rows across pages — a data-integrity-looking bug reported by users, not monitoring.Ramp-up. The source is small enough for an engineer to read end-to-end in under an hour. Onboarding cost is not comprehension — it is the unanswered ownership question and the absence of any upstream to lean on.
How can I help you explore Laravel packages today?