Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Http Macros

Laravel Http Macros Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Extending the functionality of the Laravel HTTP client

Frequently asked questions about Laravel Http Macros
What is dragon-code/laravel-http-macros used for?
It extends Laravel's Http facade with chainable macros for common outbound request patterns, including headers, authentication, timeouts, retries, and JSON payloads. It is a thin convenience layer over Illuminate\Http\Client, so Laravel's existing request and response APIs remain intact. Use it when your app standardizes outbound calls through the Http facade and you want less repetitive code.
How do I install dragon-code/laravel-http-macros?
Install it with Composer using composer require dragon-code/laravel-http-macros. Laravel package auto-discovery registers what the package needs, so there is no manual service provider wiring described. After installation, the macros are available through the familiar Http facade.
Do I need to register a service provider or publish config?
No. The package is designed as a drop-in macro layer with no config, drivers, or app restructuring. It relies on Laravel package auto-discovery rather than manual provider registration. You should still review the installed macro inventory before relying on it.
Which Laravel versions does dragon-code/laravel-http-macros support?
Version 1.5.0 adds Laravel 13 compatibility and widens the illuminate/support constraint, according to the assessment. Exact PHP and Laravel bounds are not stated in the provided context, so check Packagist or the package composer.json before adopting. Confirm whether the range is additive or raises the floor and drops versions you still run.
Does it work with Laravel 13?
Yes, version 1.5.0 adds Laravel 13 compatibility. The important caveat is to verify whether that release is a widened constraint or a floor raise, and whether it includes test coverage against Laravel 13. Treat the compatibility line as evidence of maintenance, not proof that every macro uses only public PendingRequest internals.
Will these macros conflict with my own Laravel Http macros?
Yes, collision risk is real because Laravel macros are global mutable state and the last registration wins silently. Review the package's macro inventory and compare it with your first-party and vendor macros before adopting. Add a test that asserts the behavior you depend on so a silent override is caught.
Can I use Laravel's Http::fake testing helpers with these macros?
Yes. Because the macros register on Laravel's HTTP client, normal Http::fake calls and Laravel's HTTP assertions should continue to work. You should still add focused tests for the macro-specific request shape and for any macro name collision assumptions.
Is dragon-code/laravel-http-macros safe and actively maintained for production?
Supply-chain risk is low: the package is MIT licensed, small, and easy to audit. It is maintained, and shipping Laravel 13 support is a positive signal, but substantive changes trace to a single human maintainer, so the effective bus factor is 1. For production, confirm the macros use only public PendingRequest and Response APIs and test the calls you depend on.
Does it work if my app uses a custom HTTP gateway instead of the Http facade?
No, or at least not directly. The macros only apply when outbound calls go through Laravel's Http facade and client. If your application routes HTTP through a bespoke gateway, the macros will be bypassed, so this package is not a fit unless you standardize on the Http facade.
What are alternatives to dragon-code/laravel-http-macros?
Use Laravel's native Http client directly, write a small set of app-specific macros, or keep a bespoke HTTP gateway if you already have one. If you only need a few patterns, vendoring those patterns avoids global macro collisions and single-maintainer dependency exposure. This package is most useful when you want a lightweight, Laravel-native convenience layer across many Http calls.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console