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

Api Rest Utils Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API response contract standardization. The 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).
  • Error taxonomy and status-code policy. The method list (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.
  • List-endpoint pagination contract. The repository trait for "find all matching a filter, ordered by criteria" encodes a product decision about whether filtering/sorting is a query-parameter convention owned by the API layer or hand-rolled per endpoint. Worth deciding explicitly before you have fifteen list endpoints with fifteen behaviors.
  • Serialization boundary ownership. Its dependency on JMSSerializer forces a decision: does the API layer own the wire format, or does the entity? That choice affects versioning, field deprecation, and how fast you can ship a breaking change.
  • Build vs buy: build. At 1 star, 0 dependents, archived, and README-level maturity, this is not a buy decision at all — it is a reference design you copy in an afternoon. Budget it as ~1 day of engineering plus an ADR, not as a dependency with an upgrade path.

When to Consider This Package

Consider it as a design reference (not a dependency) when:

  • You are on Symfony, not Laravel — the README is explicit ("api rest project under symfony"), so if your stack is Laravel this package is a category error; the equivalents are JsonResource/ResponseFactory and LengthAwarePaginator, which cover most of this ground out of the box.
  • You are on a legacy Symfony 2.x/3.x codebase with a service-container $this->get(...) style controller and JMSSerializer already wired in — the sample code will look like home.
  • You need a compact, auditable checklist of REST outcomes for a spec review, an OpenAPI draft, or an API style guide.
  • You are scoping a small internal helper and want prior art for the response-envelope shape before writing your own.

Look elsewhere when:

  • You want a maintained dependency. It is archived — no security patches, no PHP 8 / Symfony 6-7 support, and zero downstream users to shake out bugs.
  • You are on modern Symfony. Use #[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.
  • You need authentication, rate limiting, content negotiation, or HATEOAS — none of that lives here.
  • You depend on the trait coupling to your Doctrine repositories and expect to migrate ORMs later.
  • Licensing/maintenance provenance matters for your compliance review; a 1-star archived repo with a README-only maturity signal will not survive it.

How to Pitch It (Stakeholders)

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.

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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums