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

Laravel Rest Api Laravel Package

lomkit/laravel-rest-api

lomkit/laravel-rest-api is a Laravel package for quickly building production-ready JSON APIs. Define resources declaratively and get automatic CRUD endpoints, powerful filters, sorting, pagination, relationship includes, validation, authorization, and OpenAPI docs while staying close to Laravel conv...

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Version assessed: lomkit/laravel-rest-api v2.23.2 (patch release on the 2.23.x line; prior tag 2.23.1). Release content is a single security advisory reference — GHSA-w87g-c4fx-87gg — plus the auto-generated changelog diff. No feature, deprecation, or configuration notes are included in the release text itself.

Architecture fit: The package's value proposition is declarative API exposure over Eloquent: a Resource class declares fields(), relations(), sorts(), filters(), limits(), aggregates(), and instructions(), and a Controller subclass exposes search and mutate endpoints against it. For a Laravel application where Eloquent models and Policies are already the source of truth, this collapses a large amount of hand-written controller/request/resource boilerplate into configuration. The trade-off is an opinionated, package-owned query contract: reads are POST /{resource}/search with a structured JSON body rather than GET-with-query-params. That is a durable architectural commitment, not an implementation detail — it affects CDN/HTTP caching, gateway routing rules, API documentation tooling, and client SDK generation. It is a good fit for internal/back-office and first-party client APIs; it is a weaker fit for public APIs where GET semantics and cacheability are contractual.

Integration feasibility: High for a team already on Laravel. Integration is composer require, publish the config, define one Resource per model, subclass the controller, register routes. No database changes, no sidecar, no separate service. The realistic effort driver is not installation but authorization mapping: the package surfaces every declared field, filter, sort, relation, and aggregate through a single endpoint, so the security boundary is the union of your Policies plus the completeness of your Resource declarations. That is a reviewable but non-trivial surface, and this release is a direct signal that the surface has had at least one flaw.

Technical risk:

  • Security (elevated, this release): a published advisory implies an exploitable condition in ≤2.23.1. Without the advisory body we cannot classify it (authorization bypass via filters/relations/includes, information disclosure through undeclared fields, or injection through the search DSL are all plausible for this class of package). This is the single most important open item.
  • Contract lock-in: the search DSL becomes your public API. Migrating off the package later means reimplementing filter/sort/include semantics and preserving client behaviour.
  • Authorization-by-omission: fields/relations not declared are not exposed, which is safe-by-default, but it inverts the usual review model — reviewers must confirm absence, not presence.
  • Release cadence: 2.23.x is a fast-moving patch line. Pinning strategy and a patch-review routine are required, not optional.

Key questions (to resolve before adoption or before closing this review):

  1. What is the exact vulnerability class in GHSA-w87g-c4fx-87gg, which versions are affected, and does 2.23.2 fully remediate it (vs. requiring config or Resource changes)?
  2. Does the fix alter the search request/response shape or reject previously valid payloads? Any client-visible behaviour change makes this a minor, not a patch, from our perspective.
  3. Are we currently running an affected version, and if so, has the vulnerable path been reachable from any non-trusted client?
  4. Is there a backport for any older minor we still operate?
  5. Who owns the Resource declarations as the authorization review artifact?

Integration Approach

Stack fit: Requires a modern Laravel/PHP baseline (PHP 8.x, Laravel 10/11 era for the 2.x line) and assumes Eloquent + Laravel Policies as the persistence and authorization layers. Compatible with Sanctum/Passport for auth and with standard Laravel middleware for throttling. It does not replace your auth model — it delegates to it — so no identity refactor is implied.

Migration path: Two distinct paths, different risk:

  • Greenfield / hand-written controllers → package: incremental and low risk. Introduce one Resource at a time alongside existing routes; run both; retire the legacy controller per resource once parity is proven.
  • v1 → v2: not a patch upgrade. Treat as a re-integration with breaking changes to resource/controller signatures and the query contract. Budget a dedicated workstream and a client-compatibility plan.

Compatibility: Verify the pinned version against our exact Laravel/PHP versions before anything else. Confirm interaction with any existing query-layer packages (e.g. spatie/laravel-query-builder) — running two query-DSL layers over the same models is a source of confusing authorization gaps and should be avoided. Confirm the package's route registration coexists with existing route groups, middleware stacks, and API versioning prefixes.

Sequencing:

  1. Triage (now, hours): read the advisory, determine exposure, patch to 2.23.2 in every environment regardless of adoption decision. If already deployed, treat as a security incident with a defined disclosure/comms path.
  2. Pin and gate: exact-version pin, lockfile committed, automated dependency PRs enabled with a mandatory security-advisory check.
  3. Pilot (1–2 sprints): one low-blast-radius Resource (internal, read-only search, no mutations) behind the existing auth stack.
  4. Authorization test matrix: for the pilot, enumerate every declared field/filter/sort/relation/aggregate and assert allow/deny per role. This matrix, not the code, is the artifact that makes later Resources safe.
  5. Expand: additional Resources, then mutations, then aggregates — in that order, since aggregates are the highest-cost queries and mutations the highest-consequence.
  6. Contract publication: document the search DSL and version it before external consumers depend on it.

Operational Impact

Maintenance: Low steady-state effort but non-zero: the 2.23.x line ships frequently, and this release demonstrates that patches can be security-bearing. Assign an owner for dependency updates and a standing rule that security-tagged releases are applied within the defined SLA (typically 24–72h for internet-facing surfaces).

Support: Failure diagnosis moves one layer down — a malformed or rejected search payload surfaces as a package-level validation error rather than a hand-written controller's response. Support engineers and on-call need the DSL documented and a decoder for common client mistakes (unknown field, undeclared relation, exceeded limit). Without that, routine client errors get escalated as incidents.

Scaling: Three predictable pressure points: (a) includes drive eager-loading but deep or wide relation graphs can still produce large result sets and heavy queries; (b) aggregates execute at request time against production tables and are the most likely source of slow queries — mandate indexes on any field declared sortable or aggregatable; (c) the POST-based search endpoint is not CDN-cacheable, so all read traffic reaches the application tier. Capacity models must assume no edge caching for reads unless a cache layer is added at the application level. Rate limiting on the search endpoint should be treated as mandatory, not optional.

Failure modes:

  • Authorization regression from an over-broad Resource declaration — highest severity, hardest to detect, mitigated only by the test matrix.
  • Unbounded aggregate or deep includes causing database saturation under adversarial or careless clients.
  • Unindexed sort/filter fields degrading silently as data grows.
  • Upgrade-induced contract break if a future release is treated as a routine patch without reading its notes — the pattern this release itself establishes.
  • Vendor lock-in realized at the worst time: an urgent migration off the package under a security deadline.

Ramp-up: A Laravel-fluent developer is productive on the package in roughly one to two weeks; the learning curve is the DSL and the Resource declaration model, not Laravel. The TPM-side ramp-up is separate and should not be underestimated: the team needs an owned, reviewed inventory of what each Resource exposes, because that inventory — not the framework — is the actual access-control specification.

Recommendation: Apply 2.23.2 immediately as a security patch and treat the advisory text as a required input. Do not treat this release as evidence against the package, but do treat it as evidence that the authorization surface needs an explicit, tested, owned specification before the package is expanded beyond a single pilot Resource.

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.
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator