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
Doctrine Pagination Bundle

Doctrine Pagination Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

javihgil/doctrine-pagination-bundle provides simple, reusable pagination for Doctrine queries in Symfony applications. It wraps query building so you can paginate results without hand-writing LIMIT/OFFSET logic or separate count queries, returning page metadata alongside your entities. Ideal for controllers and APIs that need consistent, predictable paging.

  • Doctrine integration — paginate DQL/QueryBuilder results directly
  • Page metadata — total items, page count, current page, and per-page size
  • Configurable limits — control page size and boundaries via configuration
  • Symfony bundle — registers services and configuration automatically
  • Lightweight — minimal setup, no heavy dependencies or custom ORM layer
Frequently asked questions about Doctrine Pagination Bundle
Does javihgil/doctrine-pagination-bundle work with Laravel?
No. Despite being catalogued alongside PHP packages, this is a Symfony bundle: it ships a Bundle subclass registered in config/bundles.php, a DependencyInjection extension, and YAML/XML service definitions. Laravel has no bundle, compiler-pass, or DI-extension concept, so Composer discovery will find no provider to register and none of the bundle's services will ever be wired. It will install into a Laravel app because Composer does not care, but you will hit class-not-found errors at first use without a port.
How do I install and register this bundle in a Symfony application?
Install it with Composer and then register the bundle in config/bundles.php, which is how Symfony loads the service definitions the package ships. Because it depends on Doctrine ORM, DoctrineBundle should already be configured with a working entity manager. After registration the bundle's pagination services become available through the container, and there is no Laravel-style provider or config publishing step.
Which Symfony, PHP, and Doctrine ORM versions does this package support?
The release history stops at 2022-12-20, so assume the constraints target roughly PHP 7.x through 8.0, Symfony up to 5.x, and Doctrine ORM 2.x around 2.14 or earlier. Doctrine ORM 3.0 changed paginator and query-building APIs, so resolution against it is likely to fail. Run composer why-not with your target versions before planning any spike.
What does this bundle add over Doctrine's built-in Paginator?
Doctrine already ships Doctrine\ORM\Tools\Paginator, including the HINT_ENABLE_DISTINCT option for joins that duplicate rows. This bundle's plausible differentiator is ergonomics: parsing ?page and ?limit from the request into a paginated result value object, and possibly a Twig helper. That is roughly 100 to 150 lines of code, so weigh whether it is worth a dependency versus writing it yourself.
Can I render paginated Doctrine results in Twig with this bundle?
Yes, the bundle's value proposition is turning a Doctrine query into a page of results that templates can iterate, and a Twig helper is part of the ergonomic layer it adds. The practical caveat is that the integration exists only inside a Symfony application with DoctrineBundle configured, because the package is a Symfony bundle rather than a framework-agnostic library. In Laravel, use Blade with LengthAwarePaginator instead.
Is javihgil/doctrine-pagination-bundle maintained and safe for production?
Treat it as unmaintained: the last release was 2022-12-20 and the project shows zero stars and zero dependents. Zero dependents means there is no field validation of correctness or edge cases anywhere in the wild, so you would be the only known production consumer. The intrinsic attack surface is low because there is no auth, crypto, or deserialization, but an unmaintained transitive dependency is by definition unpatchable; the realistic risks are dependency lock-in and silent COUNT-handling bugs.
What are the maintained alternatives for pagination in Symfony?
BabDevPagerfanta and KnpPaginatorBundle are the actively maintained options, and both have Symfony 6/7 and Doctrine ORM 3 support. They have real release cadences and dependents, which is exactly what this package lacks. Prefer one of them unless a specific ergonomic feature here cannot be replicated cheaply.
How do I paginate Doctrine results in Laravel without this bundle?
Use doctrine/orm directly, optionally with laravel-doctrine/orm, wrap Doctrine\ORM\Tools\Paginator around your query, and adapt the result to Laravel's LengthAwarePaginator using AbstractPaginator::resolveCurrentPage(). That keeps pagination small, testable, and owned by your team. Laravel's own query-builder paginator is also available for Eloquent or the query builder, but it does not apply to DQL.
Will it work with Doctrine ORM 3 or Symfony 6 and 7?
Likely not without a fork. Doctrine ORM 3.0 in 2024 changed paginator and query-building APIs, and the bundle's constraints almost certainly predate Symfony 6 and 7. Verify with composer why-not before spending time, and plan on owning the fork if you must keep it.
How should I evaluate this package before adopting it?
First resolve the stack question: the brief says Laravel, the package says Symfony, and every downstream decision depends on that answer. Then run composer why-not against your target PHP, symfony/*, and doctrine/orm versions to see whether the constraints resolve at all. Finally, name the concrete capability you need that Doctrine\ORM\Tools\Paginator plus Laravel's LengthAwarePaginator do not already provide, and if there is not one, do not adopt it.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource