Download the PHP package alexjustesen/php-openbrewerydb without Composer
On this page you can find all versions of the php package alexjustesen/php-openbrewerydb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexjustesen/php-openbrewerydb
More information about alexjustesen/php-openbrewerydb
Files in alexjustesen/php-openbrewerydb
Package php-openbrewerydb
Short Description Unofficial PHP SDK for Open Brewery DB
License MIT
Homepage https://github.com/alexjustesen/php-openbrewerydb
Informations about the package php-openbrewerydb
Open Brewery DB SDK (PHP)
PHP SDK for Open Brewery DB api.
Sponsor
Like this package? Consider sponsoring me to help me reach my goals.
Install
Usage
Authentication
v1 of OpenBreweryDB API does not enforce any authentication patterns but rate limiting does exist.
Initialize the request
To get started create a new instance of the SDK.
Handling the response
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 brewery and formatting the response as json.
List breweries
Additional methods for filtering results:
$request->filterByCity('hartford')
-string
$request->filterByName('broad brook')
-string
$request->filterByPostal('06002')
-string
$request->filterByState('connecticut')
-string
$request->filterByType('micro')
-string
Additional methods for sorting results:
$request->sortBy('type,name:asc')
-string
orarray
$request->sortByDistance(41.96200785, -72.66266463)
- $lat:float
, $lon:float
Get a brewery
Get random breweries
Available parameters
size
, default =1
Search breweries
Autocomplete breweries
Testing
Using PHP CS Fixer
Using Pest
./vendor/bin/pest
``