carsdotcom/php-request-class
carsdotcom/php-request-class adds structured request objects to Laravel, letting you wrap input parsing, validation, and typed access in dedicated classes instead of cluttering controllers. Keeps request handling clean, explicit, and easy to test.
parseResponseString(), postProcess(), responseFromCache(), log()). It is a decision to standardize third-party integrations rather than hand-rolling clients per service.getExtendedData()/->errors(), instead of looking like an unremarkable success. This directly improves debugging and incident triage for every integration built on the package — a genuine product-quality win, not just internal plumbing.log() is now invoked on every outcome, cache hit or miss, with a default guard on responseIsFromCache. Previously cache hits were silently unlogged. This enables cache-hit-rate reporting and cost/latency attribution per integration — useful if we plan to expose upstream dependency health or caching ROI to stakeholders.log() fires and what it receives. Any team-owned request class that overrides log() without calling parent::log() will begin logging on cache hits, and any postProcess() that rejects with a non-Throwable, non-JSON-serializable value can now cause the entire log write to abort — masking the real error with a logging exception. This is a risk item that must gate the upgrade, not a footnote.getExtendedData() now land in the same log entry as the response body. If any of that can contain PII, tokens, or internal identifiers, we have a new data-exposure surface in log storage and log-shipping pipelines. This is a privacy/compliance decision, not purely engineering.BadResponseException/RequestException) may now contain the response body twice — once standalone, once nested in the stringified exception. Any dashboards, alerting rules, log parsers, or tests that structurally parse log files (e.g. counting blank-line-delimited sections) need revisiting.Throwable and suggest simplifying cache-hit logging by overriding log() directly instead of responseFromCache(). That is directionally a tightening of the extension contract; expect future majors to enforce it. Plan extension points accordingly rather than investing in the legacy responseFromCache() pattern.Adopt / upgrade when:
log() fires on cache hits.log() overrides, verify parent::log() or an explicit responseIsFromCache guard; verify every postProcess() rejects only with Throwable; review exception payloads for sensitive data; update structural log-parsing tests.Look elsewhere / defer when:
Http facade is lower overhead than adopting a class hierarchy and its extension contracts.log()/postProcess() overrides and no reliable inventory — the migration audit is the real cost, and v2.0.0's failure mode (a non-Throwable rejection silently wiping the entire log entry) is a nasty one to discover in production.array_map(stringify_body, ...) outside its own try/catch, so logging is best-effort, not durable.For executives: This is a major-version upgrade to the shared request-class library that standardizes how we call external APIs. It fixes a real defect where failed responses were being logged as successes, which has been actively misleading our incident response. It also gives us cache-hit visibility we didn't have, supporting cost and latency analysis on third-party dependencies. The cost is a bounded, well-documented migration audit across our own request classes — no new infrastructure, no vendor spend.
For engineering: v2.0.0 moves the log() call site so it runs after parseResponseBody()/postProcess(), meaning log entries now reflect the true outcome including exceptions and getExtendedData(). It also calls log() on cache hits. Six concrete audits before adopting: (1) any log() override that doesn't call parent::log() needs an explicit if ($this->responseIsFromCache) { return; } unless cache-hit logging is wanted; (2) review exception messages and getExtendedData() for sensitive content now landing in the same entry as the response body; (3) ensure postProcess() rejects only with Throwable — a non-serializable rejection now throws inside the stringify step, aborting the whole log write and masking the real error as the promise's rejection reason; (4) expect the response body to appear twice on transfer-level exceptions and recheck any structural log parsers; (5) the responseFromCache()-based manual-logging pattern still works with no double-write, but overriding log() directly is now the cleaner pattern per the AbstractRequest::log() docblock; (6) tests asserting "nothing logged on parse/postProcess failure" need updating — file count for cache misses is unchanged, but entry content now differs. For plain consumers that only override getLogFolder(), nothing changes.
How can I help you explore Laravel packages today?