🤠 Build beautiful API integrations and SDKs with Saloon
MIT License
Bot releases are hidden (Show)
Published by Sammyjo20 over 2 years ago
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...
},
);
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.11.0...v1.0.1
Published by Sammyjo20 over 2 years ago
I have decided to tag version 1.0 of Saloon. The API is now stable, with small tidy-ups and optimisations that can be done, but there are plenty of tests and big changes will now wait until later versions.
Have fun with Saloon!
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.10.0...v0.10.1
Published by Sammyjo20 over 2 years ago
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
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.9.1...v0.9.2
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.9.0...v0.9.1
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.3...v0.9.0
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.2...v0.8.3
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.8.1...v0.8.2
Published by Sammyjo20 over 2 years ago
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
Published by Sammyjo20 over 2 years ago
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
Published by Sammyjo20 over 2 years ago
assertSent
would not check against the full history by @Sammyjo20 in https://github.com/Sammyjo20/Saloon/pull/34
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.7.1...v0.7.2
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.7.0...v0.7.1
Published by Sammyjo20 over 2 years ago
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
Published by Sammyjo20 over 2 years ago
Introducing a new way to use Saloon! You can now register your requests within your connector to use it just like an SDK. Take a look:
// Currently, the only way to make requests...
$request = new GetForgeServerRequest(serverId: 123456);
$response = $request->send();
// Introducing the new "SDK" API!
$connector = new ForgeConnector();
$request = $connector->getForgeServerRequest(serverId: 123456);
$response = $request->send();
// You can even use static methods...
$request = ForgeConnector::getForgeServerRequest(serverId: 123456);
$response = $request->send();
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.6.5...v0.6.6
Published by Sammyjo20 over 2 years ago
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.6.4...v0.6.5
Published by Sammyjo20 over 2 years ago
AlwaysThrowsOnErrors
trait to a connector it would fail.Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.6.3...v0.6.4
Published by Sammyjo20 over 2 years ago
cookies()
method from SaloonResponseFull Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.6.2...v0.6.3
Published by Sammyjo20 over 2 years ago
getGuzzleException()
to SaloonResponseSaloonRequestException
effectiveUri()
and handlerStats()
from responsegetSaloonRequestOptions
to getRequestOptions
Full Changelog: https://github.com/Sammyjo20/Saloon/compare/v0.6.1...v0.6.2