Git Product home page Git Product logo

laravel-postcodeapi's Introduction

Laravel PostcodeApi

Build Status Total Downloads Latest Stable Version MIT Licensed

Installation

Install this package with composer:

composer require nickurt/laravel-postcodeapi

Copy the config files for the api

php artisan vendor:publish --provider="nickurt\PostcodeApi\ServiceProvider" --tag="config"

Examples

Default - en_AU

$postCode10 = PostcodeApi::create('PostcodeApiComAu')->find('3066');

Default - en_GB

$postCode11 = PostcodeApi::create('GeoPostcodeOrgUk')->find('SW1A1AA');
$postCode12 = PostcodeApi::create('GetAddressIO')->find('SW1A1AA');
$postCode13 = PostcodeApi::create('IdealPostcodes')->find('SW1A1AA');
$postCode14 = PostcodeApi::create('PostcodesIO')->find('SW1A1AA');
$postCode15 = PostcodeApi::create('UkPostcodes')->find('SW1A1AA');

Default - en_US

$postCode16 = PostcodeApi::create('Algolia')->find('92270');
$postCode17 = PostcodeApi::create('Bing')->find('92270');
$postCode18 = PostcodeApi::create('Geocodio')->find('92270');
$postCode19 = PostcodeApi::create('Google')->find('92270');
$postCode20 = PostcodeApi::create('Here')->find('92270');
$postCode21 = PostcodeApi::create('LocationIQ')->find('92270');
$postCode22 = PostcodeApi::create('Mapbox')->find('92270');
$postCode23 = PostcodeApi::create('OpenCage')->find('92270');
$postCode24 = PostcodeApi::create('TomTom')->find('92270');

Default - fr_FR

$postCode25 = PostcodeApi::create('AdresseDataGouv')->find('75007');
$postCode26 = PostcodeApi::create('AdresseDataGouv')->findByPostcodeAndHouseNumber('75007', '5 Avenue Anatole France');

Default - nl_BE

$postCode27 = PostcodeApi::create('Pro6PP_BE')->find('1000');

Default - nl_NL

$postCode28 = PostcodeApi::create('ApiPostcode')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode29 = PostcodeApi::create('NationaalGeoRegister')->find('1118CP');
$postCode30 = PostcodeApi::create('NationaalGeoRegister')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode31 = PostcodeApi::create('PostcoDe')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode32 = PostcodeApi::create('PostcodeApiNu')->find('1118CP');
$postCode33 = PostcodeApi::create('PostcodeApiNu')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode34 = PostcodeApi::create('PostcodeData')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode35 = PostcodeApi::create('PostcodeNL')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode36 = PostcodeApi::create('PostcodesNL')->find('1118CP');
$postCode37 = PostcodeApi::create('PostcodesNL')->findByPostcodeAndHouseNumber('1118CP', '202');
$postCode38 = PostcodeApi::create('Pro6PP_NL')->find('1118CP');
$postCode39 = PostcodeApi::create('Pstcd')->find('1118CP');
$postCode40 = PostcodeApi::create('Pstcd')->findByPostcodeAndHouseNumber('1118CP', '202');

Route

Route::get('/{postCode}', function($postCode) {
    $postCode41 = PostcodeApi::create('PostcodeApiNu')->find($postCode);
    
    return Response::json($postCode41->toArray(), 200, [], JSON_PRETTY_PRINT);
});

Providers

AdresseDataGouv, Algolia, ApiPostcode, Bing, Geocodio, GeoPostcodeOrgUk, GetAddresIO, Google, Here, IdealPostcodes, LocationIQ, Mapbox, NationaalGeoRegister, OpenCage, postco.de, PostcodeApiComAu, PostcodeApiNu, PostcodeData, PostcodeNL, PostcodesIO, PostcodesNL, Pro6PP_BE, Pro6PP_NL, Pstcd, TomTom, UkPostcodes

Tests

composer test

laravel-postcodeapi's People

Contributors

nickurt avatar bvweijen avatar laravel-shift avatar koozza avatar lamalamamark avatar arjanwestdorp avatar barryvdh avatar avido avatar dependabot-preview[bot] avatar speedykhr avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.