garethp/http-playback
Record real HTTP responses once, then replay them deterministically in your PHP tests. GarethP's HTTP Playback makes it easy to capture and reuse external API interactions, keeping test suites fast, reliable, and free of network flakiness.
Consider it when:
^2.0), vendor or fork it, and wrap it behind an internal adapter.Look elsewhere when:
Http::fake() covers the majority of feature-test needs; reach for playback only when real captured payloads (headers, pagination, error bodies) genuinely add fidelity.MockHandler, or Symfony HttpClient's mock responses.For executives: Our integration-heavy features currently depend on live third-party APIs during testing, which makes builds flaky and occasionally billable. This MIT-licensed library lets us record those interactions once and replay them deterministically — faster, cheaper, more reliable CI, and a quicker loop for shipping API-dependent features. The new 2.0 release brings it onto current PHP 8 and Guzzle 7, so it installs cleanly on our stack. The cost to trial is on the order of a day of engineering, and it is trivially reversible.
For engineering: It's a small, PSR-18/Guzzle 7-compatible record-and-replay layer; fixtures live in the repo, so replay is deterministic and offline. v2.0 is a breaking release — Guzzle 7 is now required and PHP 5.x is dropped — which for us is a net positive but means we must confirm no service is still on Guzzle 6 before adopting. Caveats we still own deliberately: the project remains low-activity with a negligible contributor base, so we pin to ^2.0, wrap it behind an internal interface to keep it swappable, and establish a fixture-redaction rule so credentials and PII never reach version control. Treat it as a utility we control, not a dependency we rely on.
How can I help you explore Laravel packages today?