everycheck/api-rest-utils
A Symfony utility package offering a JSON response builder with common API statuses and custom headers, plus a paginated repository trait for filtering, ordering, and searching entities across joins.
ResponseBuilder class is essentially a decision table: business outcome → HTTP status + JSON envelope. That maps directly to product decisions like "what does a client see when a resource is missing, forbidden by role, forbidden by ACL, or fails form validation?" Those are product-visible behaviors, not just plumbing, and this package is a checklist of the ones teams forget (conflict, formError, forbiddenAcl vs forbiddenRoute).notFound, created, deleted, conflict, badRequest, unauthorized, forbidden) is a ready-made draft of an HTTP semantics policy you can ratify in an ADR — useful when deciding whether deletes return 200 or 204, whether conflicts are 409, and how validation failures are shaped.Consider it as a design reference (not a dependency) when:
JsonResource/ResponseFactory and LengthAwarePaginator, which cover most of this ground out of the box.$this->get(...) style controller and JMSSerializer already wired in — the sample code will look like home.Look elsewhere when:
#[Route] + JsonResponse/serializer groups, or adopt API Platform if you want filtering, pagination, and OpenAPI generated rather than hand-written. FOSRestBundle and Fractal are also more complete options for the same problem.To executives: We evaluated a small open-source helper for standardizing JSON API responses. Verdict: do not adopt as a dependency — it is archived, effectively unmaintained, and has no user base. However, its response-method list is a useful 30-minute checklist of API behaviors we should decide once (missing resource, forbidden, conflict, validation error) so our clients get consistent status codes across teams. Recommended action: fund roughly one engineer-day to write ~100 lines of in-house response helpers plus a short API conventions doc. This is a cost-avoidance and consistency win, not a vendor purchase.
To engineering: This is Symfony, not Laravel, and it's a ResponseBuilder around JMSSerializer plus a Doctrine pagination/filter trait. It solves a real, recurring problem — one canonical way to return ok/created/notFound/conflict/formError instead of every controller inventing its own envelope. But it's archived, stars are negligible, and it's pinned to an older Symfony idiom ($this->get('jms_serializer')). Recommendation: treat the README as a spec, port the ~15 status helpers and the paginated-filter trait into our own ApiResponse service with tests, and make it the lint-enforced path for new endpoints. If you're on Laravel, this is already solved by JsonResource and ResponseFactory — skip it.
How can I help you explore Laravel packages today?