承接 joeymckenzie/openbrewerydb-php-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

joeymckenzie/openbrewerydb-php-api

最新稳定版本:0.9.0

Composer 安装命令:

composer require joeymckenzie/openbrewerydb-php-api

包简介

An Open Brewery DB API client for PHP.

README 文档

README

Logo

(Un)official PHP bindings for the Open Brewery DB API. Open Brewery DB provides a public dataset for breweries around the world, as well as offering an API to retrieve data in various forms. This library aims to provide straight and easy-to-use PHP bindings for querying the API. The library is inspired by the Open 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!

<?php

declare(strict_types=1);

require_once __DIR__.'/../vendor/autoload.php';

use OpenBreweryDb\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 composer dependencies. You are free to use the HTTP client of you choice, though a popular package is Guzzle.

Though I am not affiliated with organization itself, check out the entire set of APIs offered by Open Brewery DB, check out the docs on their website.

统计信息

  • 总下载量: 93
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 21
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-24