Unofficial PHP SDK for Untappd API.
Like this package? Consider sponsoring me to help me reach my goals.
composer require alexjustesen/php-untappd
The Untappd API makes use of token based authentication, you can either generate a token using your client ID and secret or using the SSO user's token.
To get started create a new instance of the SDK.
$untappd = new Untappd();
The SDK makes use of Saloon by Sam Carre, after a request is sent you can interact with the response with any of the documented methods like ->body()
or ->json()
.
In the example below we're requesting a single beer and formatting the response as json.
$request = new GetBeer('beer-id-goes-here');
$response = $untappd->send($request);
$response->json();
$request = new GetBeer('beer-id-goes-here');
$response = $untappd->send($request);
$request = new SearchBeer('brewery name or beer name string');
$response = $untappd->send($request);
composer fix-code
composer test