- Can I use ongr/pager-bundle in a Laravel application?
- No. ongr/pager-bundle is a Symfony bundle that registers through Symfony's kernel and DI container, with configuration under the ongr_pager key and no Laravel service provider, facade, publishable config, or package auto-discovery. Making it work in Laravel would mean installing symfony/framework-bundle alongside Laravel or vendoring the pagination logic out of the bundle and rewiring it yourself. In both cases you are not really using the package, so Laravel's built-in paginator is the better choice.
- Is ongr/pager-bundle still maintained?
- No. The last release was 2015-02-24 and the repository now lives in the ongr-archive organization, which means the maintainers have explicitly retired it. It has roughly 2 GitHub stars and 0 dependents, so there is no community to lean on and no third party validating compatibility with any current PHP runtime. Treat it as reference source code rather than a dependency.
- Which PHP and Symfony versions does ongr/pager-bundle support?
- It targets the Symfony 2.3 to 2.8 era on PHP 5.5 and 5.6, with Composer constraints pinned to symfony/symfony ~2.3. On a modern PHP 8.x and Laravel project Composer will refuse to resolve it without --ignore-platform-reqs hacks, and the code is likely to fatal on functions removed since PHP 7. Expect no return types, no null coalescing operator, and Symfony 2.x interfaces such as ContainerAwareInterface.
- How do I install ongr/pager-bundle with Composer?
- You would run composer require ongr/pager-bundle, but it will not resolve cleanly in a current Laravel project because of its Symfony 2.x and PHP 5.5 constraints. The bundle is enabled through Symfony's AppKernel and configured under the ongr_pager config tree, none of which exists in Laravel. Installing it is technically possible with platform requirement overrides, but that is not a path you should take for production code.
- Does ongr/pager-bundle support Elasticsearch pagination?
- Yes, that is exactly what it does: it is a thin presentation layer over ongr/pager and, in practice, ongr/elasticsearch-bundle, providing pager services, configurable page ranges, and Twig helpers for paged search results. The catch is that adopting it means adopting the whole ONGR Elasticsearch stack, which is itself archived and unmaintained. That is a large dependency surface to buy for what amounts to cursor and offset math.
- What should I use instead of ongr/pager-bundle in Laravel?
- For Eloquent or query builder results, Laravel's core LengthAwarePaginator and CursorPaginator already solve this, and paginate() handles the request plumbing for you. If you are paginating Elasticsearch, a small wrapper around from/size plus search_after for deep pages is roughly 50 lines and gives you full control. Either way you avoid an abandoned Symfony 2 dependency.
- Does ongr/pager-bundle work with Eloquent or MySQL?
- No. Its abstractions, including AbstractPager, PagerInterface, PagerManager and the adapters, assume an ONGR-configured Elasticsearch document manager, and page resolution comes from the Symfony request stack. There is no Eloquent, query builder, or generic PDO adapter. If your backend is MySQL, Laravel's paginator covers the use case without any extra package.
- Is ongr/pager-bundle safe to run in production?
- Risky and largely non-mitigable. The code is abandoned and receives no CVE monitoring, so a dependency audit will flag it, and its transitive Symfony 2 constraints can drag known-vulnerable framework versions back into your lock file. PHP 8.x incompatibility is likely a hard fatal rather than a suppressible warning. The only unambiguous positive is its clean MIT license.
- Can I use ongr/pager-bundle's Twig helpers with Laravel Blade?
- Not directly. The helpers rely on Twig 1.x template syntax, so you would need to add Twig and a Twig bridge to a Blade-based application, which is a lot of ceremony for pagination links. Blade already ships paginator views for Laravel's own paginators. Skimming the Twig extension for link-generation patterns and reimplementing them in Blade is simpler.
- What license is ongr/pager-bundle, and can I reuse its pagination logic?
- It is MIT licensed, which is permissive and the one clean aspect of the package. You can legally copy or adapt the code, and skimming AbstractPager for its interface shape before writing your own paginator is a reasonable use. Just do not expect the inherited edge-case behavior to buy you anything, since correct offset and deep-page pagination is straightforward to implement natively.