kherge/json
kherge/json is a PHP library for encoding and decoding JSON through a clean, object-oriented API. It adds validation, detailed error handling, and configurable formatting on top of PHP's native JSON functions, making data exchange safer and easier to manage.
jsonlint CLI supports a pre-commit hook or pipeline stage that validates composer.json, config manifests, and fixture files before merge — a cheap reliability win to scope into a platform/DX epic.NOASSERTION license, and an unmaintained release cadence are themselves a product decision input: this belongs on the "do not adopt without a fork/exit plan" list, not the "approved vendor" list.Consider it when:
Json facade-style wrapper (decode, encode, lint, validate) is a reasonable API shape to imitate in a first-party helper.Look elsewhere when:
json validation rule and Json rule, so basic linting is a solved problem in core; do not add a dependency for it.$ref resolution across files, or performance on large payloads — evaluate opis/json-schema or justinrainbow/json-schema directly.NOASSERTION license. Treat this as a hard gate, not a footnote. Either get written clarification or budget for a clean-room reimplementation.To executives: This is a small, single-purpose library that validates JSON documents and checks them against a schema, plus a command-line linter we can drop into CI. It is not a platform bet. The recommendation is not to adopt it as a dependency — it is unmaintained, and its license metadata is unresolved, which makes it a legal and security liability for a marginal capability. Instead, we take two things from it: (1) a CI lint stage for checked-in JSON, which is low-cost and reduces config-breakage incidents, and (2) a validated pattern for schema-checking partner and webhook payloads, implemented on a maintained library. Net effect: same reliability outcome, no orphaned dependency.
To engineering: Laravel core already covers JSON syntax validation. The only gap is JSON Schema validation, and this package is a wrapper over a dependency you would install anyway. If we need schema validation, depend on the maintained library directly; if we need a linter in CI, thirty lines of first-party code and no new vendor. Revisit only if we inherit a legacy PHP 7 service where it already resolves cleanly — and even then, plan the exit.
How can I help you explore Laravel packages today?