spiral/snapshots
Laravel snapshot testing helpers for asserting arrays, JSON, and HTTP responses against stored snapshots. Generate, update, and compare snapshots in tests to catch unexpected changes with clear diffs and simple PHPUnit integration.
This package provides a set of interfaces for defining exception handling behavior within the Spiral Framework—specifically, it defines the SnapshotsInterface used to mark exception handlers that should capture and store snapshot data (e.g., for debugging, logging, or replay). Since it's a subtree split and last released in 2019, it’s primarily relevant if you’re working with older Spiral Framework versions (v2.x). To begin, install it via Composer if your project depends on legacy Spiral components (composer require spiral/snapshots). Its interfaces (Spiral\Snapshots\SnapshotsInterface) are typically implemented by custom exception handlers, and registered via Spiral’s container bindings or auto-wiring. First, locate how Spiral\Snapshots\SnapshotsInterface is used in your app—usually in a custom ExceptionHandler that implements this interface to indicate snapshot capture is enabled.
SnapshotsInterface in your custom exception handler to signal that the handler should produce a "snapshot" (a serializable representation of the exception state) for later inspection or replay.Spiral\Exceptions\HandlerInterface—often, handlers implement both HandlerInterface and SnapshotsInterface.SnapshotInterface (in a sibling package like spiral/snapshots-store) for serialization.handle() method to return a snapshot only for certain exceptions (e.g., 5xx errors, not 4xx), enabling fine-grained control over debugging fidelity.spiral/framework directly and deprecates snapshots in favor of spiral/exceptions with built-in snapshot support. Avoid new reliance unless maintaining legacy apps.spiral/exceptions, spiral/framework) to make it functional.Spiral\Snapshots is removed or aliased to avoid conflicts with newer Spiral\Exceptions types.ExceptionHanlderInterface and tagged as snapshots-enabled (via interface matching or explicit binding in Bootloader).SnapshotsInterface in unit tests to verify your handler’s snapshot logic without relying on external storage.How can I help you explore Laravel packages today?