PHPackages                             mmerlijn/laravel-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mmerlijn/laravel-postcode

ActiveProject[Utility &amp; Helpers](/categories/utility)

mmerlijn/laravel-postcode
=========================

Laravel postcode nl helper package

v3.0.3(5mo ago)048MITPHPPHP ^8.2

Since Jun 17Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/mmerlijn/laravel-postcode)[ Packagist](https://packagist.org/packages/mmerlijn/laravel-postcode)[ RSS](/packages/mmerlijn-laravel-postcode/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (9)Used By (0)

Laravel Postcode
================

[](#laravel-postcode)

### Installation

[](#installation)

##### Install package

[](#install-package)

```
composer require mmerlijn/laravel-postcode

```

##### Optional Publish config file (for customisation)

[](#optional-publish-config-file-for-customisation)

```
php artisan vendor:publish --provider="mmerlijn\LaravelPostcodeServiceProvider" --tag="config"

database_connection_name => default: mysql_postcode
postcode_table_name => default: postcode_nl
postcode_table_not_found =>default: postcode_not_found

route.prefix    => default: postcode
route.middleware => default: ['web']

```

### Usage

[](#usage)

Postcode request

```
POST: ../postcode/getAddress {city:...,building:...}

//Required: city and building
```

Response

```
//on success example
status:200
data:{
    "postcode": "1187LS"
    "nr": "3 a"
    "building_nr": "3"
    "building_addition": "a"
    "street": "Westwijkplein"
    "city": "Amstelveen"
    "province": "Noord-Holland"
    "lat": "52.281458330925"
    "long": "4.8261185828603"
    "success": true
    "error": null
}
//on not found failure example
status:200
data:{
    "postcode": "1187LS"
    "nr": "3 a"
    "building_nr": "3"
    "building_addition": "a"
    "street": ""
    "city": ""
    "province": ""
    "lat": ""
    "long": ""
    "success": false
    "error": 'Postcode not found'
}
//on invalid request
status:422
Usual laravel validation errors
```

### Usefull methods

[](#usefull-methods)

Scopes

```
$p = Postcode::getAddress($city,$building)->first();
```

Static methods

```
$c = Postcode::getCity($postcode); //returns name of city or empty string

$c = Postcode::getCityCoordinates($city); // return array ['lat'=>...,'long'=>...]
$c = Postcode::getPostcodeCoordinates($postcode); // return array ['lat'=>...,'long'=>...]
$c = Postcode::getCoordinates(postcode/city);  // return array ['lat'=>...,'long'=>...]
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance70

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~126 days

Total

8

Last Release

170d ago

Major Versions

v1.6 → v2.02024-06-17

v2.0.1 → v3.02024-06-17

PHP version history (2 changes)v1.5PHP ^8.1

v2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/84de98c9a1803dbd730aabade43023ab14d7df77a5e71c012ecdd1150b300213?d=identicon)[mmerlijn](/maintainers/mmerlijn)

---

Top Contributors

[![mmerlijn](https://avatars.githubusercontent.com/u/8401393?v=4)](https://github.com/mmerlijn "mmerlijn (15 commits)")

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[anteris-dev/data-transfer-object-factory

Gives an easy-to-use API for mocking Data Transfer Objects.

4087.4k](/packages/anteris-dev-data-transfer-object-factory)

PHPackages © 2026

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