NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #674 most downloaded on Packagist
Build beautiful API integrations and SDKs with Saloon
Latest stable
v4.5.2
Last release 18 days ago
04 Nov 2026
Release timing varies
gaps range from 9 days to 6 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
139 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Fix | Rewind Stream Before Being Accessed by @Sammyjo20 in https://github.com/saloonphp/saloon/pull/278
Full Changelog: https://github.com/saloonphp/saloon/compare/v2.9.1...v2.9.2
Fix | Change Composer name to saloonphp/saloon by @Sammyjo20 in https://github.com/saloonphp/saloon/pull/272
Full Changelog: https://github.com/saloonphp/saloon/compare/v2.9.0...v2.9.1
Fix a typo in MocksRequestsTest by @szepeviktor in https://github.com/Sammyjo20/Saloon/pull/270
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.8.1...v2.9.0
Explicitly cast "expires_in" field to an integer by @mabdullahsari in https://github.com/Sammyjo20/Saloon/pull/252
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.8.0...v2.8.1
Feature | Updated .gitattributes to ignore phpstan files by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/241
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.7.0...v2.8.0
Feature | HasStreamBody by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/236
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.6...v2.7.0
Feature | Add Dependabot config by @JonPurvis in https://github.com/Sammyjo20/Saloon/pull/225
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.5...v2.6.6
Fix | Added support for Guzzle promises v2 by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/224
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.4...v2.6.5
Cast total results to int before returning by @craigpotter in https://github.com/Sammyjo20/Saloon/pull/214
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.3...v2.6.4
Fix | Fixed bug with responses not returning the new instance by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/207
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.2...v2.6.3
Fix | Rewinds the body if it is seekable by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/205
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.1...v2.6.2
File handles are not properly closed until a process fully terminates by @juse-less in https://github.com/Sammyjo20/Saloon/pull/202
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.6.0...v2.6.1
Update FUNDING.yml by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/196
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.5.0...v2.6.0
Feature | Added setUrl and setMethod to PendingRequest by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/190
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.4.0...v2.5.0
Feature | Installed parallel testing pest plugin by @sneycampos in https://github.com/Sammyjo20/Saloon/pull/182
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.3.0...v2.4.0
Added debugging helpers by @juse-less in https://github.com/Sammyjo20/Saloon/pull/165
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.2.0...v2.3.0
Add additional query params to the getAuthorizationUrl method for V2 by @craigpotter in https://github.com/Sammyjo20/Saloon/pull/174
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.1.0...v2.2.0
Feature | Added request modifier to OAuth2 process by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/171
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.2...v2.1.0
Saloon V2 fix: expires_in should be optional by @WalrusSoup in https://github.com/Sammyjo20/Saloon/pull/170
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.1...v2.0.2
Fix | Authenticate a PendingRequest after being constructed by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/168
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0...v2.0.1
Fix usages of expectDeprecationMessage by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/153
Official Release of Saloon v2 🎉
expectDeprecationMessage by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/153Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.6.0...v2.0.0
Fix usages of expectDeprecationMessage by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/153
expectDeprecationMessage by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/153Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0-beta6...v2.0.0-beta7
Added and corrected type hints and DocBlocks across the board by @juse-less in https://github.com/Sammyjo20/Saloon/pull/143
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0-beta5...v2.0.0-beta6
Feature | V2 Better Merging Pipeline by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/144
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0-beta4...v2.0.0-beta5
Feature | V2 Defaults Class by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/142
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0-beta3...v2.0.0-beta4
Feature | V2 Allow other simulated responses to take priority by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/141
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0-beta2...v2.0.0-beta3
Feature | V2 Beta improvements by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/139
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v2.0.0-beta1...v2.0-beta2
It's finally time for the first Saloon v2 beta! After months of work and pretty much rewriting the core code, Saloon v2 is finally in beta for you to
It's finally time for the first Saloon v2 beta! After months of work and pretty much rewriting the core code, Saloon v2 is finally in beta for you to try out. Please provide feedback on the main issue.
Issue: https://github.com/Sammyjo20/Saloon/issues/64 Docs: https://docs.saloon.dev/v/2/
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.6.0...v2.0.0-beta1
(V1) Fix | Use of null in MockResponse data by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/231
null in MockResponse data by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/231Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.7.0...v1.7.1
Add additional query params to the getAuthorizationUrl method for V1 by @craigpotter in https://github.com/Sammyjo20/Saloon/pull/175
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.6.2...v1.7.0
Feature | Support Laravel 10 by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/161
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.6.1...v1.6.2
Add brand new logo to the project by @caneco in https://github.com/Sammyjo20/Saloon/pull/147
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.6.0...v1.6.1
Fix | Support PHP 8.2 by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/126
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.5.3...v1.6.0
Feature | Added new dom() method for parsing HTML and XML by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/102
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.5.2...v1.5.3
enhance: UrlHelper join method handle endpoint URL string by @ashleyhood in https://github.com/Sammyjo20/Saloon/pull/101
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.5.1...v1.5.2
Fix | Leading Slash When Base URL is empty and endpoint in request is a URL by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/92
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.5...v1.5.1
Added funding by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/82
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.4.3...v1.4.4
Feature | Improved GitHub Workflow by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/75
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.4.2...v1.4.3
Fix docblock in SaloonResponse by @szepeviktor in https://github.com/Sammyjo20/Saloon/pull/69
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.4.1...v1.4.2
Added missing test for using invokable classes for mocking.
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.4.0...v1.4.1
Feature | Added closure mocking by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/66
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.3.3...v1.4.0
- Updated composer.json Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.3.2...v1.3.3
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.3.2...v1.3.3
Fix | Cleanup Composer.json by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/65
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.3.1...v1.3.2
Feature | Spring cleaning & added authentication alias by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/63
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.3.0...v1.3.1
> Read the documentation here: https://docs.saloon.dev/advanced/oauth2-authentication
Read the documentation here: https://docs.saloon.dev/advanced/oauth2-authentication
Version 1.3 introduces OAuth2 helpers/boilerplate code for the Authorization Code Flow! 🥳 It will allow you to write all the OAuth2 client configuration in a connector that you can use to:
<?php
use Sammyjo20\Saloon\Helpers\OAuth2\OAuthConfig;
use Sammyjo20\Saloon\Http\SaloonConnector;
use Sammyjo20\Saloon\Traits\OAuth2\AuthorizationCodeGrant;
class SpotifyAuthConnector extends SaloonConnector
{
use AuthorizationCodeGrant;
public function defineBaseUrl(): string
{
return 'https://accounts.spotify.com';
}
protected function defaultOauthConfig(): OAuthConfig
{
return OAuthConfig::make()
->setClientId('my-client-id')
->setClientSecret('my-client-secret')
->setDefaultScopes(['user-read-currently-playing'])
->setRedirectUri('https://my-app.saloon.dev/auth/callback')
->setAuthorizeEndpoint('authorize')
->setTokenEndpoint('token')
->setUserEndpoint('user')
}
}
$authConnector = new SpotifyAuthConnector;
// 1. Redirect the user to the authorization URL...
$authorizationUrl = $authConnector->getAuthorizationUrl($scopes, $state);
// 2. Handle the callback from the API provider and create an access token...
$authenticator = $authConnector->getAccessTokens($code, $state);
// 3. Authenticate your requests!
$request = new GetTracksRequest;
$request->withAuth($authenticator);
$request->send(); // 🚀
// 4. Refresh your access tokens...
$newAuthenticator = $authConnector->refreshAccessTokens($authenticator);
Previously you could define custom methods on the connector to call requests in Saloon, like so:
Previously you could define custom methods on the connector to call requests in Saloon, like so:
protected array $requests = [
'getMyUser' => UserRequest::class,
ErrorRequest::class,
];
This was pretty limited as you couldn't define "groups" of requests.
This PR introduces an extension to this API and now you can define an array of requests, keyed for a collection or a custom "RequestCollection" which is a class that extends the base "RequestCollection" class and can have completely custom methods inside. You will also have access to the connector.
$connector->user()->get()
protected array $requests = [
'user' => [
'get' => UserRequest::class,
],
];
$connector->user()->get()
protected array $requests = [
'user' => UserCollection::class,
];
class UserCollection extends RequestCollection
{
public function get(): SaloonRequest
{
return $this->connector->request(new UserRequest);
}
}
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v1.1.0...v1.2.0
Introducing asynchronous request support for Saloon! There is now a new sendAsnc method on both the request and the connector and when used, it will r
Introducing asynchronous request support for Saloon! There is now a new sendAsnc method on both the request and the connector and when used, it will return an instance of Guzzle Promise which you can then use in your application.
$request = new GetUserRequest(userId: 1);
$promise = $request->sendAsync();
$promise->then(
function (SaloonResponse $response) {
// Handle successful response...
},
function (SaloonRequestException $exception) {
$response = $exception->getSaloonResponse();
// Handle unsuccessful response...
},
);
Removed InstalledVersions from Laravel check by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/53
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.11.0...v1.0.1
Mocking exceptions by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/49
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.10.0...v0.10.1
This release introduces a new feature into Saloon, authenticators. Easily authenticate with your API integrations using the built in methods or create
This release introduces a new feature into Saloon, authenticators. Easily authenticate with your API integrations using the built in methods or create your own custom authenticators.
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.9.2...v0.10.0
Added new send and request methods to the connector
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.9.1...v0.9.2
Fixed an issue where the "default" method on the Keychain did not return an instance of the class.
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.9.0...v0.9.1
Renamed "setLoadedConnector" to "setConnector" on SaloonRequest.
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.3...v0.9.0
Fixed an issue trying to convert an unsuccesful response to a dto by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/44
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.2...v0.8.3
Changed DTO property type to protected by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/42
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.1...v0.8.2
This release introduces a first-party way to cast directly to a DTO of your choice.
This release introduces a first-party way to cast directly to a DTO of your choice.
Firstly, add the "CastsToDto" trait to your request. After that, you need to add the "castToDto" method on the request. This should return your DTO with the data populated inside of it.
public function castToDto(SaloonResponse $response): object
{
return User::fromSaloon($response);
}
After your request has been sent, you can use the dto method on the response to retrieve your DTO.
$response = UserRequest::make()->send();
$dto = $response->dto(); // Data\User
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.0...v0.8.1
The biggest release in terms of changes for Saloon, be careful there are quite a number of breaking changes as Saloon leads up to v1.0 so keep an eye…
The biggest release in terms of changes for Saloon, be careful there are quite a number of breaking changes as Saloon leads up to v1.0 so keep an eye out for them below.
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.7.2...v0.8.0
Fixed an issue where assertSent would not check against the full history by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/34
assertSent would not check against the full history by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/34Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.7.1...v0.7.2
Update HasFormParams.php by @ronnievisser in https://github.com/Sammyjo20/Saloon/pull/33
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.7.0...v0.7.1
You can now assert that Saloon has sent the correct response in your application! The following expectation methods have been added:
You can now assert that Saloon has sent the correct response in your application! The following expectation methods have been added:
Here's how you can use it:
// Laravel (using Facade)
Saloon::assertSent(GetForgeServerRequest::class);
// Normal PHP
$mockClient->assertSent(GetForgeServerRequest::class);
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.6.6...v0.7.0
One column per quarter.