PHPackages                             greeneh/postcode - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. greeneh/postcode

ActiveLibrary[Search &amp; Filtering](/categories/search)

greeneh/postcode
================

Unified search for postcodes across various different providers.

0.0.1(11y ago)9551PHPPHP &gt;=5.3.0

Since Sep 24Pushed 11y ago1 watchersCompare

[ Source](https://github.com/garygreen/Postcode)[ Packagist](https://packagist.org/packages/greeneh/postcode)[ RSS](/packages/greeneh-postcode/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Postcode Search
===============

[](#postcode-search)

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

---

Installation
------------

[](#installation)

With composer - add to your `requires` section:

- "greeneh/postcode": "~0.0.1"

### Laravel Specific

[](#laravel-specific)

Add the following to your `config/app.php`

1. `providers` array:

'Greeneh\\Postcode\\PostcodeServiceProvider',

2. `aliases` array

'Postcode' =&gt; 'Greeneh\\Postcode\\Facades\\Postcode',

Usage
-----

[](#usage)

### Retrieving geograhic information from a postcode:

[](#retrieving-geograhic-information-from-a-postcode)

```
Postcode::search('E16 1FW')
```

#### Result from using the Google API Provider

[](#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

[](#get-the-latlng-from-a-postcode)

```
Postcode::getCoordinates('E16 1FW')
```

#### Result

[](#result)

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

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4254d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0865c9c1a3ef07b6500069c71a320337ca47b4dfa8032118f0fb21d4ee362330?d=identicon)[garygreen](/maintainers/garygreen)

### Embed Badge

![Health badge](/badges/greeneh-postcode/health.svg)

```
[![Health](https://phpackages.com/badges/greeneh-postcode/health.svg)](https://phpackages.com/packages/greeneh-postcode)
```

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M203](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M65](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[shyim/opensearch-php-dsl

OpenSearch/Elasticsearch DSL library

175.9M9](/packages/shyim-opensearch-php-dsl)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
