gollumsf/rest-bundle
gollumsf/rest-bundle is a Symfony bundle for building RESTful APIs with less boilerplate. It helps configure resource endpoints, handle requests, serialize responses, and keep JSON API output consistent across services.
COUNT, and LIMIT on multiplied rows returns short, non-deterministically wrong pages). The fix — COUNT(DISTINCT root.id) plus aggregate-based ordering (MIN asc / MAX desc) grouped by the root identifier — is real engineering, not boilerplate. This informs the build-vs-buy calculus: if the team ever hand-rolls pagination over joined collections, this is the specific class of bug they will ship. Budget for it explicitly, or accept a dependency that has already solved it.QueryBuilder rather than rewrite it, so existing queryCallback logic using groupBy/having/distinct keeps working, and query count stays at two. That third criterion is the discriminating one — Doctrine's Paginator fails it, and most in-house implementations fail it silently.Adopt only if all of the following hold:
Look elsewhere when:
distinct/groupBy handling rather than Doctrine aggregates.Executives: We re-reviewed gollumsf/rest-bundle following v4.2.1. The new release is a real correctness fix — paginated lists over joined collections were returning wrong totals and short, non-deterministically incomplete pages; the package now counts distinct entities and orders by aggregates so pages are complete. This is competent work with a broad test matrix and 100% stated coverage, and it materially improves our read on the maintainer's capability. Our recommendation is unchanged: do not adopt as a production dependency. GPL-3.0 creates distribution exposure, and a single-maintainer project with no downstream dependents concentrates support risk on us. The cost of adoption is low; the cost of ownership and legal review is not, and the capability it provides is one we can absorb deliberately rather than inherit.
Engineering: The release fixes two coupled defects. Joining a to-many relation multiplies rows, so COUNT over the joined set over-counted (40 authors became 56), and LIMIT applied to multiplied rows returned fewer hydrated entities than requested (limit 5 → 4 entities), non-deterministically depending on duplicate position in the window. The fix uses COUNT(DISTINCT root.id) and orders collection-traversing sorts on an aggregate of the joined column — MIN ascending, MAX descending — grouped by the root identifier, so fan-out disappears. Notably, it deliberately avoids Doctrine's Paginator, which would fix both problems but rewrites the query into subqueries and breaks when a queryCallback has already applied groupBy, having, or distinct; the aggregate approach only adds to the QueryBuilder, keeps existing callbacks working, and holds at two queries. To-one relations and plain-column sorts are untouched, so the upgrade profile is clean.
The engineering takeaway is not "adopt it" — it's "don't underestimate this problem." If we build collection pagination ourselves, we need to solve row fan-out in counting, determinism of page boundaries under join-induced duplicates, and composability with caller-supplied query modifiers, without escalating query count. If we do take the dependency, vendor it and pin it; if we don't, port the pattern, not the code, into an internal MIT/Apache-licensed convention package.
Decision: Reject for production; license and bus-factor remain disqualifying. Use as a read-only reference for pagination design, and adopt its three acceptance criteria — entity-accurate totals, deterministic page size, additive-only query modification — into our own API toolkit requirements. Separately, close out the package-discovery pipeline flag: a GPL Symfony bundle surfaced in a Laravel-oriented evaluation with previously future-dated release metadata still indicates sourcing criteria that need tightening.
How can I help you explore Laravel packages today?