sqits/laravel-postcode
Composer 安装命令:
composer require sqits/laravel-postcode
包简介
Laravel wrapper for the postcode-nl api
README 文档
README
Installation and usage
This package requires PHP 7.2 and Laravel 5.8 or higher. Install the package by running the following command in your console;
composer require sqits/laravel-postcode
You can publish the config file with:
php artisan vendor:publish --provider="Sqits\Postcode\PostcodeServiceProvider" --tag="config"
This is the contents of the published config file:
/* * Request options required for GuzzleHttp client. */ 'requestOptions' => [ /* * URI * * Settings which api url the package should use. There are several endpoints available */ 'uri' => [ 'extension' => env('POSTCODENL_URI_EXTENSION', 'nl'), ], /* * Authentication * * Register an account with Postcode.nl to obtain a key and secret. See https://api.postcode.nl/#register for * further information. */ 'auth' => [ env('POSTCODENL_KEY', null), env('POSTCODENL_SECRET', null) ], /* * Timeout (in seconds) * * By default, the client waits 10 seconds for a response. You may set a different timeout. */ 'timeout' => env('POSTCODENL_TIMEOUT', 10), ], /* * Enable routes * * This package comes with a set of routes, which are not loaded by default. In order to use them, set this * option to true. */ 'enableRoutes' => env('POSTCODENL_ENABLE_ROUTES', false),
Using the JSON API
In order to use the API, enabled it in the configuration. When enabled, the following route is available:
route('postcode-nl::address', [$postcode, $houseNumber, $houseNumberAddition = null]);
or use the following URL (e.g. for AJAX calls):
/postcode-nl/address/{postcode}/{houseNumber}/{houseNumberAddition?}
Configuration
Credentials (required)
The key and secret are used for authentication. Without them, you cannot use the service.
POSTCODENL_KEY=<your-api-key> POSTCODENL_SECRET=<your-secret>
Enable routes (optional)
This package comes with a ready to use JSON API, which is disabled by default. You can enable it like so:
POSTCODENL_ENABLE_ROUTES=true
Timeout (in seconds, optional)
By default, the client waits 10 seconds for a response. You may set a different timeout.
POSTCODENL_TIMEOUT=<timeout-in-seconds>
Changelog
Please see CHANGELOG for more information what has changed recently.
Security
If you discover any security-related issues, please email to info@sqits.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
sqits/laravel-postcode 适用场景与选型建议
sqits/laravel-postcode 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 293 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 10 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「zipcode」 「postcode」 「nederland」 「postcode nederland」 「postcode-nl」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sqits/laravel-postcode 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sqits/laravel-postcode 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sqits/laravel-postcode 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Spikkl API client library for PHP
Symfony Bundle for commonground balance functionality
Validates Zip/Postal Codes for any country and provides each country's localized name for their version of the Zip/Postal code (CEP, PLZ, PIN code, Eircode, NPA, CAP, ZIP code, etc.).
Symfony bundle for Geonames API
Constraint class for international zipcode validation
Get Address IO wrapper covering all endpoints available from the API.
统计信息
- 总下载量: 293
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-09