ergebnis/json-pointer
RFC 6901 JSON Pointer abstraction for PHP. Create, parse, and encode reference tokens from plain strings, JSON strings, or URI fragment identifiers, with helpers to output JSON-safe and URI-safe forms. Install via Composer: ergebnis/json-pointer.
/users/~1id/123).Specification.update /path/to/field).{"op": "replace", "path": "/foo/bar", "value": "baz"}).Config::set("/database/timeout", 30)).Specification::closure() for allowed paths).JsonPointer::fromJsonString() vs. string concatenation)./users/* only).json_decode() + manual traversal.*"This package standardizes how we navigate and validate JSON data across our systems. By adopting ergebnis/json-pointer, we:
*"This is a batteries-included solution for JSON pointers with:
JsonPointer and ReferenceToken value objects prevent runtime errors.Specification lets us enforce rules (e.g., ‘only allow /users/* paths’).#/path/to/field) and JSON Patch.
Trade-offs:fromJsonString() vs. fromUriFragmentIdentifierString().How can I help you explore Laravel packages today?