saloonphp/saloon
Saloon is a PHP HTTP client framework for building clean, reusable API integrations. Create connectors and requests, handle auth, middleware and retries, mock and test easily, and keep endpoints organized with strong typing and a fluent DX.
StripeConnector, TwilioRequest). This reduces coupling between business logic and HTTP clients, improving testability and reusability.RetryMiddleware, LoggingMiddleware), allowing cross-cutting concerns (auth, rate limiting) to be defined once and reused across connectors.PaymentIntent::fromResponse($response->json())).ApiRequestSent, ApiResponseReceived) via middleware, enabling observability (e.g., logging, monitoring) without polluting business logic.HttpClient facade, Illuminate\Support\Facades\Http). Existing Laravel HTTP logic (e.g., Http::post()) can be gradually migrated to Saloon’s structured approach.AppServiceProvider, with connectors bound as singletons or contextual bindings (e.g., app()->bind(StripeConnector::class, fn() => new StripeConnector(config('stripe')))).Http facade or Guzzle. Mitigation: Pair programming and internal documentation (e.g., "Saloon vs. Guzzle" cheat sheet).stripe/stripe-php), duplication of effort may arise. Mitigation: Benchmark Saloon vs. vendor SDKs for maintainability (e.g., mocking, customization) before adoption.MockPaymentGateway).Http::get()) or only new integrations?Http facade, GuzzleHttp, or Symfony HTTP Client.Authenticator classes.ApiRequestFailed) for reactive workflows.MockClient enables isolated API testing without external calls.config('api.base_url')) work seamlessly with Laravel Sail.new SaloonStripeConnector($guzzleClient)).feature() to toggle between old (Guzzle) and new (Saloon) implementations.Http Facade: Replace all Http::get() calls with Saloon connectors.App\Middleware\LogRequests) with Saloon-specific middleware.Illuminate\Support\Facades\Http).ApiConnector with shared middleware).Http facade) with Saloon.How can I help you explore Laravel packages today?