Alto JSON Patch applies RFC 6902 operations and generates deterministic patches between PHP values.
<?php
use Alto\JsonPatch\JsonPatch;
$document = ['status' => 'draft'];
$patch = [
['op' => 'replace', 'path' => '/status', 'value' => 'published'],
];
$result = JsonPatch::apply($document, $patch);Introduction
- Installation: install the package and verify the runtime.
- Getting started: apply and generate a first patch.
Patching
- Applying: use the six RFC 6902 operations and handle failures.
- Diffing: generate stable object and list changes.
- Pointers: address document values with RFC 6901 paths.
The package transforms in-memory values and JSON strings. Persistence, authorization, version storage, and conflict resolution remain application responsibilities.