eastwest/json
A lightweight Laravel/PHP package that wraps JSON handling in a clean, fluent API, making it easy to encode, decode, inspect, and manipulate JSON data safely inside your applications.
null and silently degrade. This package exists to force the former.require" rule, or for an explicit exception process where the code is vendored and owned internally.JSON_THROW_ON_ERROR). Adopting it is a signal that a service is pinned to an old runtime — which feeds directly into upgrade prioritization.null ambiguously.Consider it only when:
JSON_THROW_ON_ERROR isn't available, and you want exception-based JSON handling without sprinkling json_last_error() checks across dozens of call sites.Look elsewhere (or just don't adopt) when:
composer.json.To executives: This is a tiny convenience wrapper, not a platform bet. It turns json_decode() failures into exceptions so a bad payload fails loudly instead of quietly returning null — a real class of production bug. The catch is that PHP solved this natively in 7.3, in the same year this package last shipped. Recommendation: do not add it as a dependency. If a legacy service genuinely needs the behavior, vendor the ~50 lines and own them. Adoption cost is near zero, but so is the upside, and the maintenance risk is permanently ours. The more valuable output here is a policy: we don't take on archived packages to save a one-line change.
To engineering: The package is archived, unmaintained, and has no dependents — so no one else is exercising it. The entire feature is a flag: json_encode($v, JSON_THROW_ON_ERROR) and json_decode($s, true, 512, JSON_THROW_ON_ERROR). Prefer the native flag; if you need a stable, package-specific exception type, define it in your own codebase and catch JsonException in PHP 8. Treat this repo as a design reference and a substitutability lesson — 93 stars is not evidence of fitness, and a utility package that the language has since absorbed is a dependency you should decline.
How can I help you explore Laravel packages today?