hpolthof/laravel-postcode-tech
Composer 安装命令:
composer require hpolthof/laravel-postcode-tech
包简介
Package to use postcode.tech with Laravel.
README 文档
README
This is a Laravel implementation for the API of Postcode.Tech. You need an API key for this API to work. You can register for free and create an API Key.
The packages uses the PHP implementation of Postcode.tech.
Installation
To install use composer
composer require hpolthof/laravel-postcode-tech
Usage
Register at Postcode.Tech and create an API token.
Add the following to your .env file:
POSTCODE_TOKEN="{YOUR TOKEN HERE}"
During installation a service provider and facade will be automatically discovered.
You can now lookup a postcode using:
$address = \Postcode::find('1071BM', 29); if ($address) { $street = $address->street(); $city = $address->city(); }
The method find() will return null if the postcode is not found and will return an
exception if there was an error during the API request. These exceptions can be found at: https://github.com/hpolthof/postcode-tech/tree/master/src/Exceptions.
Disclaimer
This package can be used free of charge. Obviously this software comes as is, and there are no warranties or whatsoever.
If you like the package it is always appreciated if you drop a message of gratitude! ;-)
The package was build by: Paul Olthof
统计信息
- 总下载量: 66
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: gpl-3.0
- 更新时间: 2020-02-25