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

Product Decisions This Supports

  • Build vs. buy for API response layers. This package extends Laravel's native API Resources with query-parameter-driven capabilities (field selection, relationship includes, configurable pagination), so it directly informs the "do we build our own serialization layer or adopt an off-the-shelf one" decision. Adopting it shifts effort from plumbing to product surface area.
  • API contract and versioning strategy. A resource abstraction layer standardizes how the team exposes models over HTTP, which affects decisions about public API shape, backwards compatibility guarantees, and how quickly new endpoints can be shipped without re-litigating response formats.
  • Laravel upgrade roadmap. v1.10.0 adds Laravel 11.x compatibility, which removes a hard blocker on the framework upgrade path. This unblocks sequencing decisions: whether to upgrade Laravel first, the package first, or both together, and whether the platform team can commit to a supported-version window.
  • Client-facing feature velocity. Sparse fieldsets and relationship includes let mobile/web clients request exactly what they need, which supports decisions about payload-size budgets, mobile performance work, and reducing round-trips — often a cheaper lever than new endpoints.
  • Technical debt and dependency posture. The package's release cadence and framework-support lag become inputs to the dependency risk register, influencing whether it is treated as a strategic dependency or a contained utility.
  • Team standardization. Choosing one resource layer over ad-hoc toArray() implementations is a consistency decision that affects onboarding cost, code review velocity, and documentation effort.

When to Consider This Package

Consider adoption when:

  • The product exposes a JSON API consumed by multiple clients (web SPA, mobile, third parties) where response shape flexibility has real value.
  • The team is on Laravel 10/11 and expects to stay on supported framework versions; v1.10.0 explicitly targets Laravel 11.x, so the upgrade path is currently clear.
  • You are already using Laravel's native API Resources and are feeling the limits — repetitive conditional field logic, inconsistent pagination, manual relationship loading.
  • You want query-parameter conventions (field selection, includes) without hand-rolling and maintaining them across dozens of endpoints.
  • You need a thin, single-purpose dependency rather than a full API framework or spec-compliant JSON:API implementation.

Look elsewhere when:

  • You need strict JSON:API compliance or an established spec (use a dedicated JSON:API package or an API Platform approach).
  • You are on a non-Laravel PHP stack, or on a Laravel version outside the supported range — the package tracks framework releases reactively, so a lag between Laravel majors and package support is expected and should be budgeted for.
  • The API surface is small and stable (a handful of endpoints); the abstraction cost likely exceeds the benefit.
  • You require a formal support contract, SLA, or vendor accountability — this is community-maintained, and the release history here is routine maintenance rather than a commercial support signal.
  • Your organization has strong opinions on response shape driven by an external contract you cannot control; the package's conventions may fight those requirements.

How to Pitch It (Stakeholders)

For executives: This is a small, low-risk open-source library that standardizes how our Laravel services format API responses. The immediate news is a maintenance release adding Laravel 11 support, which keeps our framework upgrade path open and avoids a scheduling conflict on the platform roadmap. No breaking changes, no migration work, no new operational burden. The decision it supports is whether to keep standardizing our API layer on this package or absorb that work in-house — the former is materially cheaper for a team of our size.

For engineering leadership: v1.10.0 is a compatibility release: Laravel 11.x support plus a CI cleanup removing --ignore-platform-reqs, which means the test suite now runs against real platform constraints rather than bypassing them. That is a modest but meaningful quality signal — the maintainers are tightening their build rather than loosening it. There are no new features and no deprecations, so adoption risk is unchanged from v1.9.0; the practical effect is that the package is no longer a blocker in a Laravel 11 upgrade plan.

For engineering teams: Nothing in this release requires code changes. If you are planning a Laravel 11 upgrade, this package now clears the way and should be bumped in the same pass. The relevant caveat is that framework support here is maintained reactively by a small contributor base — treat it as a dependency to watch at each Laravel major, and pin versions accordingly.

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