laralabs/get-address-io
Composer 安装命令:
composer require laralabs/get-address-io
包简介
Laravel package for getAddress.io
README 文档
README
Laravel getAddress.io Package
This package allows you to easily interact with the getAddress.io API and cache full postcode results to reduce quota usage.
🚀 Quick Start
Installation
Require the package in the composer.json of your project.
composer require laralabs/get-address-io
Publish the configuration file.
php artisan vendor:publish --tag=getaddress-config
Edit the configuration file and set your desired settings, the cache is disabled by default and you will need to set the following env variables:
GETADDRESS_API_KEY=
GETADDRESS_ADMIN_KEY=
If you have enabled the cache, make sure you run the migration:
php artisan migrate
Usage
A helper function and facade is available, choose your preferred method.
The facade is located at Laralabs\GetAddress\Facades\GetAddress
The endpoints currently supported are (support for other endpoints coming soon):
- find
- autocomplete
- get
Perform a lookup using the find endpoint:
$results = get_address()->find($postcode, $property);
The $property argument is optional, just searching for a postcode will return all results for that postcode and also cache the data if the cache has been enabled.
Perform a looking using the autocomplete endpoint:
$results = get_address()->autocomplete($searchTerm, ['top' => '20']);
The second argument supports an array of parameters to send with the POST request, the example above shows setting the returned results to the maximum allowed of 20.
Perform a lookup using the get endpoint:
$results = get_address()->get($addressId);
This is used with the autocomplete endpoint to return the full address information, the $addressId argument must be the ID returned from the autocomplete response.
💬 Support
Please raise an issue on GitHub if there is a problem.
🔑 License
This is open-sourced software licensed under the MIT License.
laralabs/get-address-io 适用场景与选型建议
laralabs/get-address-io 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 62.52k 次下载、GitHub Stars 达 3, 最近一次更新时间为 2019 年 07 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 laralabs/get-address-io 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 laralabs/get-address-io 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 62.52k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-11