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 Resources Laravel Package

juampi92/api-resources

juampi92/api-resources extends Laravel's Eloquent API resources with query-string controls for sparse fieldsets, nested includes, and filtering, letting clients request exactly the data they need while you keep resource definitions clean, consistent, and reusable.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Basis of assessment: No prior assessment existed and no structured package data was supplied. This evaluation is derived from the v1.10.0 release notes alone; treat conclusions as provisional pending the evidence checks below.

Architecture fit

  • juampi92/api-resources is a presentation-layer package layered on Laravel's Eloquent API Resources, adding query-driven behaviour (relationship include and sparse fields selection) without touching persistence, schema, or infrastructure.
  • Fits cleanly into a standard Laravel HTTP layer: it is a Composer-only dependency with no services, queues, migrations, or config sprawl.
  • Best fit where we already use Laravel Resources and are hand-rolling serializers or response shaping; poor fit if the API surface is fixed/contract-first (GraphQL, gRPC, OpenAPI-generated) or if clients must not control field selection.

Integration feasibility

  • Install is a single composer require; adoption is opt-in per Resource class, so blast radius is limited to endpoints we choose.
  • Real effort is governance, not plumbing: defining which relationships and fields are externally addressable, and holding response shapes stable.

Technical risk

  • v1.10.0 is a compatibility-and-hygiene release, not a feature release. Content: Laravel 11.x compatibility (PR #17, via Laravel Shift automation) and removal of --ignore-platform-reqs from CI (PR #18).
  • No breaking changes, deprecations, or config/API changes are announced. Minor version bump is consistent with SemVer for added framework support.
  • Removing --ignore-platform-reqs is a mild positive: CI now validates real platform requirements instead of masking them. It also means previously tolerated environment mismatches may now fail fast — verify the require block for new ext-* or PHP floor constraints before pinning.
  • Principal structural risks: single-maintainer project (bus factor of one), small contributor base, and an external contributor's first contribution being the Laravel 11 compatibility PR — framework support arriving via automation rather than an owned test matrix.
  • Recency signal: Laravel 11 support landed in this release rather than at Laravel 11 GA, implying a reactive rather than pre-emptive compatibility posture. Expect similar lag for Laravel 12.

Key questions

  • Does the CI matrix actually exercise Laravel 9/10/11 across supported PHP versions, or only the newest pairing?
  • Did PR #17 widen the illuminate/* constraint, or bump it in a way that silently drops older Laravel support?
  • What is the adoption footprint (Packagist installs, dependents) and issue-response latency?
  • Is there a stated support/deprecation policy for future Laravel majors and PHP minors?
  • Does the include/fields query API collide with existing query-parameter contracts, cache keys, or gateway/CDN caching rules?
  • What is the package's security disclosure process?

Integration Approach

Stack fit

  • Laravel 9–11 with a modern PHP 8.x runtime, Composer-managed. No adjacent infrastructure required.
  • Aligns with our existing Resource-based serialization; does not force an architectural change.

Migration path

  • No migration is implied by this release — it is additive compatibility. Existing deployments on v1.9.x gain Laravel 11 support by constraint bump only.
  • For teams currently on custom serializers, adopt incrementally per endpoint rather than replacing the serialization layer wholesale. Coexistence is supported because the package composes with, rather than replaces, Laravel Resources.

Compatibility

  • Pin ^1.10 and reconcile against the application's laravel/framework version. Confirm no transitive constraint conflict with other illuminate-dependent packages (common offenders: auth, permission, and admin-panel packages).
  • Audit the package composer.json require block post-#18 to confirm no new platform extensions are demanded.
  • Explicitly note the current ceiling: nothing in this release claims Laravel 12 or PHP 8.4 support. Do not assume forward compatibility.

Sequencing

  1. Desk check (hours): diff v1.9.0…v1.10.0, read composer.json, inspect CI workflow file to confirm the test matrix.
  2. Spike (1–2 days): apply to one low-traffic read endpoint; verify include/fields behaviour, error handling on unknown parameters, and query counts.
  3. Policy definition: per-endpoint allowlists for includes and fields; document as API contract.
  4. Contract tests: snapshot response shapes and assert query-count ceilings before wider rollout.
  5. Domain-by-domain rollout, not organisation-wide, with a documented rollback (constraint downgrade to v1.9.x is safe given no breaking changes).

Operational Impact

Maintenance

  • Small code surface, infrequent releases. Low ongoing toil, but single-maintainer dependency means we should track upstream quarterly and be prepared to fork or vendor if the project stalls — especially at the next Laravel major.
  • Record the pinned version and the diff review date in the dependency register so the next framework upgrade has a known starting point.

Support

  • Community-supported only; no vendor SLA, no commercial backing. Requires a named internal owner for upgrades and issue triage.
  • Support burden concentrates at framework upgrade windows, not steady state.

Scaling

  • Primary scaling concern is not throughput but query amplification: unrestricted include parameters invite N+1 queries and deep relationship traversal.
  • Mitigations: server-side include allowlists, mandatory eager-load declarations, query-count assertions in CI, and response caching keyed on the normalized include/fields set.
  • Sparse fieldsets reduce payload size, which is a net positive for bandwidth-bound clients — but only if the cache key includes the field selection.

Failure modes

  • Composer resolution failure during a Laravel upgrade (constraint lag behind framework releases).
  • Silent response-shape drift across minor versions — low likelihood given the release history, but unverified without contract tests.
  • Over-exposure: an attacker or naive client requesting unintended relationships, leaking fields or degrading performance.
  • Maintainer abandonment leaving the package incompatible with a future Laravel major.

Ramp-up

  • Roughly half a day for a Laravel-fluent engineer to read the package API, plus one day to author internal conventions for allowed includes/fields per endpoint.
  • Produce a short internal note covering: how to declare resources, how to register allowlists, and why unbounded includes are prohibited. This is the highest-leverage onboarding artifact for this dependency.

Recommendation (provisional): adopt for incremental, endpoint-scoped use behind allowlists; do not standardise org-wide until the CI matrix and constraint behaviour are confirmed and a maintenance contingency is agreed.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console