PHPackages                             juststeveking/laravel-postcodes - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. juststeveking/laravel-postcodes

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

juststeveking/laravel-postcodes
===============================

A service wrapper around postcodes.io

4.1.0(1y ago)81136.0k↓54.8%20[2 issues](https://github.com/JustSteveKing/LaravelPostcodes/issues)[1 PRs](https://github.com/JustSteveKing/LaravelPostcodes/pulls)MITPHPPHP ~7.2|^8.0CI failing

Since Oct 14Pushed 1y ago1 watchersCompare

[ Source](https://github.com/JustSteveKing/LaravelPostcodes)[ Packagist](https://packagist.org/packages/juststeveking/laravel-postcodes)[ Docs](https://github.com/JustSteveKing/LaravelPostcodes)[ GitHub Sponsors](https://github.com/JustSteveKing)[ RSS](/packages/juststeveking-laravel-postcodes/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (8)Dependencies (5)Versions (13)Used By (0)

[![](laravel-postal-code-validation.png)](laravel-postal-code-validation.png)

LaravelPostcodes
================

[](#laravelpostcodes)

[![Latest Version on Packagist](https://camo.githubusercontent.com/06a02a78f3ad1d7f1c081625d0d3a1c18087c31fb027d0cf5d50a525a1fa2f2c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75737473746576656b696e672f6c61726176656c2d706f7374636f6465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juststeveking/laravel-postcodes)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://github.com/JustSteveKing/LaravelPostcodes/workflows/build-tests/badge.svg?branch=master)](https://github.com/JustSteveKing/LaravelPostcodes/actions)[![Coverage Status](https://camo.githubusercontent.com/6bf844c3fcaee47ef463fee677c00bb0307009aafd64ea0a13ad40ccd54b3d0f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f4a75737453746576654b696e672f4c61726176656c506f7374636f6465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/JustSteveKing/LaravelPostcodes/code-structure)[![Quality Score](https://camo.githubusercontent.com/7bd82970aee6377b834731df9bba0467319e7fdc6a0b1c4fa08fc3123600313f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f4a75737453746576654b696e672f4c61726176656c506f7374636f6465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/JustSteveKing/LaravelPostcodes)[![Total Downloads](https://camo.githubusercontent.com/780c58ffa4b8dc700d8976215723401d2f81714d1dd751421041d0ccb2489e97/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a75737473746576656b696e672f6c61726176656c2d706f7374636f6465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juststeveking/laravel-postcodes)

A service wrapper around [postcodes.io](https://postcodes.io/) with validation rule and macro

Install
-------

[](#install)

Via Composer

```
$ composer require juststeveking/laravel-postcodes
```

After installation, merge configuration for services using:

```
$ php artisan vendor:publish --provider="JustSteveKing\LaravelPostcodes\PostcodesServiceProvider"
```

If, for some reason, this doesn't work please use the following steps:

- Add the following into the `config/services.php` configuration file:

```
