mstroink/overheid-io
Composer 安装命令:
composer require mstroink/overheid-io
包简介
Simple client for consuming OverheidIo API
README 文档
README
Simple PHP wrapper for Overheid.io
This package provides a simple client for consuming the OverheidIo Api.
The API documentation can be found on: https://overheid.io/documentatie. You can get an api-key here https://overheid.io/register
Installing OverheidIo
The recommended way to install Overheid-Io is through Composer.
composer require mstroink/overheid-io
After installing, you need to require Composer's autoloader:
require 'vendor/autoload.php';
Usage
use MStroink\OverheidIo\OverheidIoFactory; $overheid = new OverheidIoFactory::create($apiKey);
Or use your own (authenticated) client. An adapter is required to be an implementation of \MStroink\OverheidIo\Http\HttpClientInterface
use MStroink\OverheidIo\OverheidIo; $overheid = new OverheidIo($client);
Rdw API
// Get car info by licence plate try { $response = $overheid->rdw()->get('76-GP-LH'); } catch(\MStroink\OverheidIo\Exception\NotFoundException $e) { var_dump($e->getMessage()); var_dump($e->getCode()); var_dump($e->getPrevious()); } // Search $rdw = $overheid->rdw(); $response = $rdw ->fields(['merk', 'voertuigsoort', 'kenteken', 'eerste_kleur']) ->query('*laren') ->queryFields(['merk']) ->search();
Bag API
// Get bag info by bag id try { $response = $overheid->bag()->get('3015ba-nieuwe-binnenweg-10-a'); } catch(\MStroink\OverheidIo\Exception\NotFoundException $e) { } // Search $bag = $overheid->bag(); $response = $bag ->filters(['postcode' => '3015BA']) ->search();
Kvk API
// Get company info by kvk id try { $response = $overheid->kvk()->get('hoofdvestiging-57842019-0000-van-der-lei-techniek-bv'); } catch(\MStroink\OverheidIo\Exception\NotFoundException $e) { } // Search $response = $overheid->kvk() ->filters(['dossiernummer' => '52921506']) ->search(); // Suggest $response = $overheid->kvk() ->fields(['handelsnaam']) ->limit(10) ->suggest('Valken');
Filtering (All APIs)
$rdw = $overheid->rdw(); // Number of items returned in the response $rdw->limit(100); // Specify the page of results to return $rdw->page(1); // Control whether results are returned in ascending or descending order $rdw->order('asc'); $rdw->order('desc'); // To limit the fields fetched, you can use the fields() method $rdw->fields(['voertuigsoort', 'kenteken', 'merk', 'eerstekleur']); //Filter results by value $rdw->filters(['merk' => 'dikke-bmw']); // Query for car brand ending with laren $rdw->query('*laren'); // Apply this query on the merk field $rdw->queryFields(['merk']); // Execute $rdw->search();
Run tests
vendor/bin/phpunit
mstroink/overheid-io 适用场景与选型建议
mstroink/overheid-io 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.84k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 03 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「client」 「wrapper」 「bag」 「kvk」 「rdw」 「overheid.io」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mstroink/overheid-io 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mstroink/overheid-io 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mstroink/overheid-io 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A psr-18 compliant middleware client that handles cookies for psr-7 http messages
A bunch of idempotent static functions organised into categories to be reused in multiple projects.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
LinkedIn API PHP SDK with OAuth 2.0 & CSRF support. Can be used for social sign in or sharing on LinkedIn. Examples. Documentation.
A convenient collection for HTML meta tags
Mock PSR-18 HTTP client
统计信息
- 总下载量: 1.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2020-03-05