shipsaas/laravel-resource-reducer
Laravel Resource Reducer trims API resource payloads so you only return the fields a client actually needs. Define lean, reusable resource classes, cut response size and query overhead, and keep your JSON output consistent across endpoints.
JsonResource response layer as a presentation helper that trims fields, relationships, and nested resources without rewriting existing resource classes. TPM should position it as an optional API payload-shaping utility, not as a replacement for resource classes, serialization contracts, or authorization.composer.json configuration, so the first validation step is a clean install, package discovery, and autoload verification. Feasibility depends on confirming supported Laravel/PHP versions and the exact fluent API.JsonResource methods? Is behavior covered by tests? Is the field selection safe by default? Is v1.1.1 installable from Packagist in a clean Laravel skeleton? What is the maintenance roadmap and security posture?JsonResource usage if framework constraints align. Validate against the current Laravel version and any packages that already transform API responses.composer.json does not change autoloading or package-discovery behavior unexpectedly. Because per-request reduction changes response shape, version client-facing API schemas and document which fields are reducible.JsonResource classes and classify fields as safe-to-trim versus contract-critical; define allowlisted reducible fields and safe defaults; add response-shape contract tests; pilot one endpoint behind a feature flag; monitor payload size, error rates, and client compatibility; then expand endpoint by endpoint.JsonResource and Composer; moderate if documentation is thin or if API consumers depend on stable response schemas. Budget a short discovery spike to confirm the API, test coverage, default behavior, and security boundaries before adoption.How can I help you explore Laravel packages today?