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

Overview

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
You might also like...
📇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

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.

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

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

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).

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

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.

Library JGU is a website created for a university library system information. Made with PHP & TailwindCSS.
Library JGU is a website created for a university library system information. Made with PHP & TailwindCSS.

Library JGU Library JGU is a website created for a university library system information. Made with PHP & TailwindCSS. Key Features • How To Use • Rel

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.

Owner
Gary Green
Gary Green
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.

null 53 Dec 26, 2022
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

Sam Sam 3 Oct 21, 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

CoderKungfu 646 Dec 30, 2022
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

Sergey Komar 1.1k Dec 21, 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

Oliver Hörold 5 Nov 2, 2022
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.

null 1 Oct 3, 2022
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.

Miha Petkovsek 1.8k Dec 31, 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

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

Thành Nhân 1 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. 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.

null 4 Aug 22, 2022
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

null 236 Dec 22, 2022