Weave Code
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

Guzzle Psr18 Adapter Laravel Package

ricardofiorani/guzzle-psr18-adapter

Tiny adapter that lets you use Guzzle as a PSR-18 HTTP client. Bridges PSR-7 requests/responses and promises to the PSR-18 ClientInterface, easing migration to standards-based HTTP without rewriting existing Guzzle integrations.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • API Abstraction & Standardization: Enables alignment with PSR-18 (HTTP Client Interface) for consistent HTTP client usage across microservices, reducing vendor lock-in with Guzzle.
  • Tech Stack Modernization: Facilitates adoption of PSR standards in legacy PHP/Laravel applications, easing future migrations or integrations with other PSR-compliant libraries.
  • Build vs. Buy: Avoids reinventing a PSR-18 adapter, saving dev time while maintaining flexibility (vs. proprietary solutions).
  • Use Cases:
    • Unifying HTTP clients in a Laravel monolith or service mesh.
    • Enabling dependency injection of HTTP clients in Laravel’s service container.
    • Supporting headless browser testing (e.g., Puppeteer) or API mocking via PSR-18 interfaces.

When to Consider This Package

  • Adopt if:
    • Your team uses Guzzle and wants PSR-18 compatibility for dependency injection or interface-based testing.
    • You’re building a modular Laravel app with shared HTTP clients across services.
    • You prioritize maintainability over Guzzle’s native features (e.g., middleware, retries).
  • Look elsewhere if:
    • You need active maintenance (last release in 2021; consider forks or alternatives like php-http/guzzle7-adapter).
    • Your use case requires advanced Guzzle features (e.g., event subscribers, async requests).
    • You’re using Laravel’s HTTP client (which already supports PSR-18 via HttpClientFactory).

How to Pitch It (Stakeholders)

For Executives: "This lightweight package lets us standardize HTTP calls across our Laravel services using PSR-18, reducing technical debt and making it easier to swap clients (e.g., for testing or cost optimization). It’s a low-risk way to modernize our API layer without rewriting existing Guzzle code."

For Engineering: *"By wrapping Guzzle in PSR-18, we can:

  • Inject HTTP clients into Laravel services via the container (e.g., bind(ClientInterface::class, fn() => new GuzzlePsr18Adapter())).
  • Mock HTTP calls in unit tests without Guzzle-specific logic.
  • Future-proof the codebase for PSR-compliant tools (e.g., testing frameworks, service meshes). Tradeoff: Minimal overhead (~100 LOC), but no active updates—evaluate forks or alternatives if critical."*
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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor