- Is this bundle compatible with Laravel or only Symfony?
- This bundle is designed for **Symfony**, not Laravel. Laravel developers should evaluate alternatives like **KnpPaginator** or **Laravel Scout** for pagination, as this bundle relies on Symfony’s Doctrine and Twig ecosystem.
- Will this work with Laravel 10 and PHP 8.2?
- No, this bundle was last updated in 2019 for **Symfony 4.x** and lacks PHP 8.x support. It may break due to deprecated APIs, typed properties, and Symfony 6/7 changes. Laravel 10 requires modern, actively maintained packages.
- How do I install and configure it in a Symfony 5/6 project?
- Install via Composer: `composer require agusmoita/mottapg-bundle`. Configure it in `config/bundles.php` and extend Doctrine repositories with `buildQuery()`. However, expect compatibility issues with Symfony 5+ due to deprecated APIs like `setView()` in controllers.
- Does it support sorting, filtering, or advanced queries?
- No, this bundle focuses **only on pagination** (LIMIT/OFFSET). For sorting/filtering, you’ll need to manually extend `buildQuery()` in repositories or use a separate library like **KnpPaginator**, which includes these features out of the box.
- Why is the bundle using the deprecated `tcpdf-bundle` for exports?
- The bundle relies on `whiteoctober/tcpdf-bundle` for PDF/Excel exports, which is **obsolete**. Modern alternatives like **spipu/html2pdf** or **maatwebsite/excel** are recommended. You’ll need to replace this dependency manually if exports are required.
- Can I use this with Laravel’s Eloquent instead of Doctrine?
- No, this bundle is **Doctrine ORM-specific** and won’t work with Laravel’s Eloquent. For Eloquent pagination, use Laravel’s built-in `paginate()` method or packages like **Laravel Pagination Views** for styling.
- What are the risks of using this in production?
- High risks include **Symfony 6/7 incompatibility**, security vulnerabilities from deprecated dependencies, and lack of maintenance. Production use requires forking, patching, or replacing it with a modern alternative like **KnpPaginator** or **EasyAdmin**.
- How does it handle large datasets (e.g., 100K+ records)?
- It uses basic `LIMIT/OFFSET` pagination, which can be inefficient for large datasets due to memory and query performance. For scalability, consider **cursor-based pagination** (e.g., `LIMIT/OFFSET` alternatives) or libraries like **Laravel Scout** for search-driven pagination.
- Are there better alternatives for Symfony pagination?
- Yes. **KnpPaginator** (Symfony’s de facto standard) and **EasyAdmin** offer sorting, filtering, and modern Symfony 6/7 support. This bundle’s lack of maintenance and limited features make it a poor choice compared to actively developed alternatives.
- How can I migrate away from this bundle if needed?
- Start by replacing pagination logic with **KnpPaginator** for new features. Gradually phase out `MottaPgBundle` by updating controllers to use Knp’s `PaginatorInterface`. For Twig templates, migrate to Knp’s built-in views or custom solutions. Test thoroughly in a staging environment.