定制 wubs/postcode-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

wubs/postcode-api

最新稳定版本:1.1.43

Composer 安装命令:

composer require wubs/postcode-api

包简介

Communicates with the postcodeapi.nu api

README 文档

README

This is a simple laravel package to use the dutch postcode api.

Installation

To install this library into your project simply do the following in your project root:

composer require wubs/zip:1.1.*

Laravel specific

If you use Laravel, add 'Wubs\Zip\ZipServiceProvider', to app/config.php in the providers array and add 'Zip' => 'Wubs\Zip\Facades\Zip', to the aliases array, also in app/config.php.

Usage

You can use the facade like this:

<?php
Zip::address("1234AA", 11);

Or get it from the IoC container like so:

<?php
$api = $app->make('\Wubs\Zip\ZipApi')

Or inject it into a constructor

<?php namespace App\Http\Controllers;

use Wubs\Zip\ZipApi;

class ZipController extends Controller
{
   private $api;
   
    public function __construct(ZipApi $api)
    {
        $this->api = $api;
        
    }
}

Publish the configuration by running:

php artisan vendor:publish

Afterwards the configuration will be located in config/zip.php

I highly recommend using the .env file.

Non laravel usage

The package is also usable without Laravel. See the code below.

<?php
require 'vendor/autoload.php'

use Wubs\Zip\ZipApi;

$zipApi = new ZipApi("API_KEY");
$address = $postcodeApi->address("1234AA", 11);

统计信息

  • 总下载量: 30
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-04-20