- 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.