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
Laravel Plugin

Laravel Plugin Laravel Package

saloonphp/laravel-plugin

Laravel plugin for Saloon that adds first-class Laravel integration: config publishing, service provider bindings, facades, Artisan tooling, and convenient client setup. Makes using Saloon HTTP connectors and requests feel native inside Laravel apps.

Deep Wiki
Context7

🤠 The official Laravel plugin for saloonphp/saloon

Frequently asked questions about Laravel Plugin
How does saloonphp/laravel-plugin compare to Laravel’s built-in HTTP client (Http::)?
Unlike Laravel’s Http::, which is request-focused, this plugin organizes HTTP logic into reusable *Connectors* (e.g., StripeConnector) tied to your domain. It adds Laravel-native features like config publishing, facades, and Artisan commands, while maintaining Saloon’s fluent API for complex APIs like GraphQL or SOAP.
Can I use this plugin with Laravel 10+ and PHP 8.3?
Yes, the plugin supports Laravel 10+ and PHP 8.3, but ensure your underlying *saloonphp/saloon* package is also compatible. Check the plugin’s Composer requirements and Saloon’s changelog for breaking changes, as Saloon v2+ may introduce PHP 8.3-specific features.
How do I mock Saloon connectors in Laravel’s PHPUnit tests?
Use the built-in `MockConnector` class. Replace your connector binding in tests with `MockConnector::shouldReceive('fetchUser')->andReturn($mockData)`. This integrates with Laravel’s testing helpers and avoids HTTP calls entirely, speeding up unit tests.
Does this plugin support OAuth 2.0 or JWT authentication?
Yes, Saloon’s connectors support OAuth 2.0 and JWT via middleware. Configure it in your connector’s `withMiddleware()` method or globally in `config/saloon.php`. For OAuth, use Saloon’s `OAuth2` decorator or Laravel’s `Sanctum`/`Passport` integration with custom middleware.
Will this plugin work with Laravel’s queue system for async HTTP requests?
Absolutely. Use Saloon’s `shouldQueue()` method on connectors or wrap requests in Laravel’s `Bus::dispatch()`. This is ideal for webhooks, background syncs, or rate-limited APIs. Configure queue drivers in Laravel’s `.env` as usual.
How do I integrate Saloon’s connectors with Laravel’s service container?
Bind connectors in your `AppServiceProvider` using Laravel’s container: `$this->app->bind(StripeConnector::class, fn() => new StripeConnector(config('services.stripe.key')))`. This enables dependency injection in controllers/services and leverages Laravel’s singleton management.
Can I use this plugin for SOAP or GraphQL APIs, not just REST?
Yes, Saloon natively supports SOAP and GraphQL. Define your connector’s `endpoint()` and `method()` to handle these protocols, then use Saloon’s decorators like `GraphQL` or `Soap`. The plugin’s facades and middleware work identically across all three.
What’s the performance impact of using Saloon vs. raw Guzzle?
Saloon adds minimal overhead compared to Guzzle. For high-volume APIs, optimize with Saloon’s `cache()` decorator or Laravel’s cache drivers. Async queues (via `shouldQueue()`) further reduce latency for background tasks.
How do I debug failed Saloon requests in Laravel?
Enable Saloon’s debug mode with `Saloon::debug()` or leverage Laravel’s logging. For middleware issues, check `app/Http/Kernel.php` and use `tap()` to inspect request/response objects. The plugin integrates with Laravel’s `tap()` for real-time debugging.
Are there alternatives to this plugin for Laravel HTTP clients?
Alternatives include Laravel’s native `Http::` client, Guzzle’s standalone PHP library, or packages like *spatie/laravel-http-client*. However, this plugin uniquely combines Saloon’s robust HTTP abstraction with Laravel’s ecosystem (config, events, queues), making it ideal for complex APIs or teams using Saloon’s DDD approach.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport