cyber-duck/laravel-address-finder
Composer 安装命令:
composer require cyber-duck/laravel-address-finder
包简介
:package_description
README 文档
README
This package provides a facade for address searching. Currently the only driver is available is Loqate. There is also a mock driver for testing that does not communicate with any API's
Installation
Via Composer
$ composer require cyber-duck/laravel-address-finder
Usage
Environment Variable
The following ENV variable are available
# Address Finder ## Default: mock. Available [mock, loqate] ADDRESS_FINDER_DRIVER # This can be used to set the driver to use ## Default: false. Available [true, false] ADDRESS_FINDER_CACHE # This can be used to set if the response should be cached or not ## Default: same as CACHE_DRIVER ADDRESS_FINDER_CACHE_DRIVER # If cacheing this setting can be used to override the default cache driver used by address finder # Loquate ## Default: null LOQATE_API_KEY # Required if using the loqate driver ## Default: https://api.addressy.com/ LOQATE_API_BASE_URI # This can be used to overide the API based URI when using the loqate driver
Searching Address
// $query: The search string // $countryCode: The country code to search for addresses within // $groupId: Results can have children, if this is the case you can retrieve the results children by passing the ID Address::suggestions($query, $countryCode, $groupId);
Example
CyberDuck\AddressFinder\Facades\Address::suggestions('EC1N', 'GB', null)->get(); /* [ [ "id" => "1", "text" => "London, United Kingdom, EC1N 8TB - 2 Addresses", "has_children" => true, ], ] */ CyberDuck\AddressFinder\Facades\Address::suggestions('EC1N', 'GB', 1)->get(); /* [ [ "id" => "2", "text" => "1 Greville Street - Greville Street London, 1, United Kingdom, EC1N 8TB", "has_children" => false, ], [ "id" => "3", "text" => "2 Greville Street - Greville Street London, 2, United Kingdom, EC1N 8TB", "has_children" => false, ], ] */
Retrieving Address Details
// $addressId: The id of the address found from the suggestions method Address::details($addressId);
Example
CyberDuck\AddressFinder\Facades\Address::details('2')->get(); /* [ "postal_code" => "EC1N 8TB", "province_code" => "", "state" => "", "city" => "London", "address_line_1" => "Greville Street", "address_line_2" => "1", "address_line_3" => "", ] */
Retrieving Postzon record for the given postcode
// $postcode: The postcode to use to search with Address::postzon($postcode);
Example
CyberDuck\AddressFinder\Facades\Address::postzon('N7 7PH')->get(); /* [ 'Easting' => 530915, 'Northing' => 186310, 'Latitude' => 51.560487, 'Longitude' => -0.112808, 'OsGrid' => 'TQ 30915 86310', 'CountryCode' => '921', 'NewCountryCode' => 'E92000001', 'CountryName' => 'England', 'CountyCode' => '', 'NewCountyCode' => 'E99999999', 'CountyName' => '(pseudo) England (UA/MD/LB)', 'DistrictCode' => '', 'NewDistrictCode' => 'E09000019', 'DistrictName' => 'Islington', 'WardCode' => '00AUGC', 'NewWardCode' => 'E05013703', 'WardName' => '', 'NhsShaCode' => 'Q36', 'NewNhsShaCode' => '', 'NhsShaName' => 'London', 'NhsPctCode' => '', 'NewNhsPctCode' => 'E16000048', 'NhsPctName' => 'Islington', 'LeaCode' => '', 'LeaName' => '', 'GovernmentOfficeCode' => 'H', 'GovernmentOfficeName' => 'London', 'WestminsterConstituencyCode' => 'C36', 'WestminsterConstituencyName' => 'Islington North', 'WestminsterMP' => 'Jeremy Corbyn', 'WestminsterParty' => 'Labour', 'WestminsterConstituencyCode2010' => 'C36', 'WestminsterConstituencyName2010' => 'Islington North', 'LSOACode' => 'E01002730', 'LSOAName' => 'Islington 007A', 'MSOACode' => 'E02000560', 'MSOAName' => 'Islington 007', 'CCGCode' => '93C', 'CCGName' => 'NHS North Central London CCG', 'CCGAreaCode' => '', 'CCGAreaName' => '', 'CCGRegionCode' => '', 'CCGRegionName' => '', ] */
cyber-duck/laravel-address-finder 适用场景与选型建议
cyber-duck/laravel-address-finder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 11.49k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2020 年 08 月 27 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「laravel-address-finder」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cyber-duck/laravel-address-finder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cyber-duck/laravel-address-finder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cyber-duck/laravel-address-finder 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Laravel package for Accurate Online API integration.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
Branded, diagnostic error pages (500, 403, 404, 419, 503) for Filament — native Filament UI, dark mode and translations out of the box.
Turn any PDF into a Pingen-ready A4 letter (generated address cover page + A4 normalisation + safe margins) and send it through the Pingen print & mail API. Laravel-first.
统计信息
- 总下载量: 11.49k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-27