Simple searching for postcodes to retrieve geographic information. Support for various API providers and a unified address/output format.

Last update: Aug 4, 2021

Postcode Search

Simple searching for postcodes to retrieve geographic information. Support for various API providers and a unified address/output format.


Installation

With composer - add to your requires section:

  • "greeneh/postcode": "~0.0.1"

Laravel Specific

Add the following to your config/app.php

  1. providers array:

'Greeneh\Postcode\PostcodeServiceProvider',

  1. aliases array

'Postcode' => 'Greeneh\Postcode\Facades\Postcode',

Usage

Retrieving geograhic information from a postcode:

Postcode::search('E16 1FW')

Result from using the Google API Provider

object(Greeneh\Postcode\Address)[282]
  protected 'fillable' => 
    array (size=6)
      0 => string 'town' (length=4)
      1 => string 'city' (length=4)
      2 => string 'county' (length=6)
      3 => string 'latitude' (length=8)
      4 => string 'longitude' (length=9)
      5 => string 'source' (length=6)
  protected 'attributes' => 
    array (size=6)
      'town' => null
      'city' => string 'London' (length=6)
      'county' => string 'Greater London' (length=14)
      'latitude' => float 51.5166391
      'longitude' => float 0.0210837
      'source' => 
        object(stdClass)[246]
          public 'results' => 
            array (size=1)
              0 => 
                object(stdClass)[250]
                  public 'address_components' => 
                    array (size=6)
                      0 => 
                        object(stdClass)[232]
                          public 'long_name' => string 'E16 1FW' (length=7)
                          public 'short_name' => string 'E16 1FW' (length=7)
                          public 'types' => 

Get the lat/lng from a postcode

Postcode::getCoordinates('E16 1FW')

Result

array (size=2)
  'latitude' => float 51.6359841
  'longitude' => float 0.2919168

GitHub

https://github.com/garygreen/Postcode
You might also like...

A PHP library to read and write feeds in JSONFeed, RSS or Atom format

feed-io feed-io is a PHP library built to consume and serve news feeds. It features: JSONFeed / Atom / RSS read and write support Feeds auto-discovery

Aug 11, 2022

📇A contacts app for Nextcloud. Easily sync contacts from various devices with your Nextcloud and edit them online.

📇A contacts app for Nextcloud. Easily sync contacts from various devices with your Nextcloud and edit them online.

Nextcloud Contacts A contacts app for Nextcloud. Easily sync contacts from various devices with your Nextcloud and edit them online. This app only sup

Jul 27, 2022

DooTask is a lightweight open source online project task management tool that provides various document collaboration tools, online mind mapping, online flowcharting, project management, task distribution, instant IM, file management and other tools.

DooTask is a lightweight open source online project task management tool that provides various document collaboration tools, online mind mapping, online flowcharting, project management, task distribution, instant IM, file management and other tools.

Aug 13, 2022

Das AddOn stellt den Lottie-Player für das Abspielen von Lottie-Animationen im .json-Format zur Verfügung.

Das AddOn stellt den Lottie-Player für das Abspielen von Lottie-Animationen im .json-Format zur Verfügung.

REDAXO-AddOn: Lottie Das AddOn stellt den Lottie-Player für das Abspielen von Lottie-Animationen im .json-Format zur Verfügung. Das AddOn ermöglicht i

Jan 19, 2022

Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML

Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML

Online chatting application through a logical decentralized blockchain network that stores chat information and hashing keys implemented using AJAX, JQuery, PHP, SQL, CSS, and HTML. The blockchain stores a previous hash value, current hash value, time, chat data, and a special key(nonce) used for encryption in each block (node).

Jan 4, 2022

phpSysInfo: a customizable PHP script that displays information about your system nicely

phpSysInfo Copyright (c), 1999-2008, Uriah Welcome (sf.net/users/precision) Copyright (c), 1999-2009, Michael Cramer (sf.net/users/bigmichi1) Copyrigh

Aug 3, 2022

A Full Stack login/register system using a MySQL database to store the information

A Full Stack login/register system using a MySQL database to store the information

This is a Full Stack login/register system using a MySQL database to store the information. I created this to sharpen my Full Stack Development skills.

Jun 25, 2022

A free and open-source accounting and production system for businesses and non-profits with support for multiple users and varied integrations

A free and open-source accounting and production system for businesses and non-profits with support for multiple users and varied integrations.

Jun 8, 2022

Mibew Messenger - open-source live support application written in PHP and MySQL

Mibew Messenger is an open-source live support application written in PHP and MySQL. It enables one-on-one chat assistance in real-time directly from your website.

Jul 13, 2022
Pico disk, Not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg
Pico disk, Not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg

Nano netdisk, Now changed to pico disk. Pico disk,does not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg.

Jul 31, 2022
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP
Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP

MySejahtera-PHP-Web Retrieve MySejahtera App's data from MySejahtera API and show to users via web browser. Written in PHP. Disclaimer This web app is

Mar 31, 2022
A unified front-end for different queuing backends. Includes a REST server, CLI interface and daemon runners.

PHP-Queue A unified front-end for different queuing backends. Includes a REST server, CLI interface and daemon runners. Why PHP-Queue? Implementing a

Jul 15, 2022
Unified sample web app. The easy way to learn web frameworks.
Unified sample web app. The easy way to learn web frameworks.

Notejam The easy way to learn web frameworks Do you know framework X and want to try framework Y? The easy way to start with a new framework is to com

Aug 5, 2022
REDAXO Watson Search integration for searching inside Yrewrite redirections

yrewrite_watson_search REDAXO Watson Search integration for searching inside Yrewrite redirections Usage Keyword 'forward'. Example 'forward conversio

Sep 9, 2021
An attempt at a usable, generic VPS panel for providers and power users.

An attempt at a usable, generic VPS panel for providers and power users. Key goals are to be clean, easy to use, and support Proxmox as well as other providers (Libvirt via Go API, etc) using one simple interface.

Nov 5, 2021
phpIPAM is an open-source web IP address management application.

phpIPAM is an open-source web IP address management application. Its goal is to provide light and simple IP address management application. It is ajax-based using jQuery libraries, it uses php scripts and javascript and some HTML5/CSS3 features, so some modern browser is preferred to be able to display javascript quickly and correctly.

Aug 7, 2022
This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. It allows you to query some other server information
This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. It allows you to query some other server information

QueryServer This is a plugin written in PHP programming language and running on the PocketMine platform that works stably on the API 4.0.0 platform. I

Jul 6, 2022
Infopanel is a simple tool getting some information from source. It works basically like a slider that shows only title, image, a little bit description and QR-Code for links.
Infopanel is a simple tool getting some information from source. It works basically like a slider that shows only title, image, a little bit description and QR-Code for links.

Infopanel is a simple tool getting some information from source. It works basically like a slider that shows only title, image, a little bit description and QR-Code for links. It has its own GUI for the editing. The GUI provides a very simple role concept. This tool can be used for digital signage, Information panels, News or Events or similar.

Mar 25, 2022
Translate laravel resource, vendor, folder or file from google translation without requiring any api information
Translate laravel resource, vendor, folder or file from google translation without requiring any api information

⚡ ⚡ ⚡ Laravel Go Translate Translate laravel resource, vendor, folder or file from google translation without requiring any api information. Table of

Jun 18, 2022