dragon-code/laravel-http-macros
dragon-code/laravel-http-macros adds handy macros to Laravel's HTTP client, cutting boilerplate for common API request tasks such as headers, authentication, timeouts, retries, and JSON payloads. Build cleaner, more expressive HTTP calls with less repetitive code.
PendingRequest is already Macroable, "framework-native, thin in-house" remains the default answer — and this package is the evidence you'd cite when someone proposes a dependency for it.Accept header) once and reuse them everywhere. That directly reduces per-integration drift and the class of bugs where one service call forgets a timeout or a user agent.Http::fake() scoping, supporting a "no unmocked outbound request in CI" policy — a security and reliability win that's easy to sell and easy to measure.Adopt the pattern almost always; adopt the dependency still rarely — but the risk calculus has softened, not hardened.
Revision to prior assessment: the earlier version of this note characterized the repository as archived with no future security patches. Release 1.5.0 (Laravel 13 compatibility, maintainer-authored PR #27) contradicts that — the package is being actively tracked against current and upcoming Laravel majors. The "archived / unsafe to depend on" risk line is withdrawn. The remaining concerns are low adoption and a single maintainer, which are vetting risks, not abandonment risks. Verify current star/dependent counts and repository status before quoting any number externally; the figures in the prior draft are no longer reliable.
Consider it (as a dependency) only if:
Look elsewhere — or vendor the idea — when:
Http::macro() / PendingRequest::macro() in a dedicated service provider covers this in a few dozen lines with zero dependencies.Practical recommendation (unchanged): read the source, copy the ~100 lines of registration logic into App\Support\Http or a small provider (MIT permits it), and cite it in your internal conventions doc rather than in composer.json. If you do adopt it, pin the version, note the single-maintainer risk in your dependency register, and set a calendar reminder to re-evaluate at the next Laravel major.
To executives (one paragraph): We re-evaluated a small open-source utility for standardizing how our product calls external APIs. The pattern is worth adopting — it removes boilerplate, enforces consistent timeouts and headers, and makes outbound calls easier to test. The project is actively maintained and was just updated for the next Laravel version, which corrects our earlier assumption that it was abandoned; what remains true is that it has very little adoption and one maintainer, so it gives us no real safety net if something goes wrong. Recommendation: adopt the convention in-house, keep our dependency count unchanged, and spend the effort on an API-client standard we control. If engineering prefers the off-the-shelf version, it's now a defensible small bet rather than a red flag — just not a load-bearing one.
To engineering (the substance): 1.5.0 is a compatibility-only release: Laravel 13 support via PR #27, plus license-year and README image housekeeping. No API changes, no deprecations, no new features — nothing to migrate to, nothing to re-test beyond the Laravel 13 matrix. The package is still a thin layer over Illuminate\Http\Client\PendingRequest's macro support, letting you register named clients centrally. On Laravel 9+, Macroable already gives us this. Proposal: one HttpClientServiceProvider exposing named clients with baked-in base URL, auth, timeout, retry, and headers; a lint/test rule that fails CI on unmocked HTTP; and documentation of the convention. If the config-file registry ergonomics are appealing, either crib them from the source (MIT) or depend on it with a pinned version and a named owner.
Risk line to keep in the deck: actively maintained and tracking Laravel majors, but single-maintainer with minimal adoption — no community vetting, no credible path to a coordinated security fix. Safe to read, safe to depend on for non-critical paths, keep it off the payments/PII call graph.
How can I help you explore Laravel packages today?