- Notifications
You must be signed in to change notification settings - Fork0
🍺 An Open Brewery DB API client for PHP.
License
JoeyMckenzie/openbrewerydb-php-client
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
(Un)official PHP bindings for theOpen Brewery DB API. Open Brewery DB provides a publicdataset for breweries around the world, as well as offering an API to retrieve data in various forms. This library aims toprovide straight and easy-to-use PHP bindings for querying the API. The library is inspired by theOpen AI client for PHP - please give it star as well!
To get started, first install the package with composer:
$ composer require joeymckenzie/openbrewerydb-php-client
Next, spin up a new client within your code and fire away!
<?phpdeclare(strict_types=1);require_once__DIR__.'/../vendor/autoload.php';useOpenBreweryDb\OpenBreweryDb;$client = OpenBreweryDb::client();// Get a list of breweries, based on all types of different search criteria$breweries =$client->breweries()->list(['by_city' =>'Sacramento',]);var_dump($breweries);// Retrieve various metadata about breweries from the API$metadata =$client->breweries()->metadata();var_dump($metadata);// Get a random brewery with a specified page size$randomBrewery =$client->breweries()->random(5);var_dump($randomBrewery);
The library relies on autodiscovery and will use whichever package that implements PSR-17 within your composerdependencies. You are free to use the HTTP client of you choice, though a popular packageisGuzzle.
Though I am not affiliated with organization itself, check out the entire set of APIs offered by Open Brewery DB, checkout the docs on theirwebsite.
About
🍺 An Open Brewery DB API client for PHP.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
