PHPackages                             cline/postal-code - 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. cline/postal-code

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

cline/postal-code
=================

Validates and formats postal codes for all countries with a Laravel-first approach

2.0.3(2mo ago)01.4k↓30%1MITPHPPHP ^8.5.0CI passing

Since Dec 30Pushed 2mo agoCompare

[ Source](https://github.com/faustbrian/postal-code)[ Packagist](https://packagist.org/packages/cline/postal-code)[ RSS](/packages/cline-postal-code/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (9)Dependencies (12)Versions (15)Used By (1)

[![GitHub Workflow Status](https://github.com/faustbrian/postal-code/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/postal-code/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/54e48b525dda8970a61cf2deedf722e874005b2c76562a587e2d688ecdda0ad0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f706f7374616c2d636f64652e737667)](https://packagist.org/packages/cline/postal-code)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/e9468ef4737c39b3fec210be2e54c561126ca513907c7f2b610d3d8ec03850a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f706f7374616c2d636f64652e737667)](https://packagist.org/packages/cline/postal-code)

---

Postal Code is a Laravel package for validating and formatting postal codes across 180+ countries. It provides a fluent API with automatic normalization, country-specific formatting, and comprehensive exception handling.

This is a fork of [brick/postcode](https://github.com/brick/postcode) by Benjamin Morel, adapted for Laravel with additional features and a fluent API.

Requirements
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/) and Laravel 12+**

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

[](#installation)

```
composer require cline/postal-code
```

Documentation
-------------

[](#documentation)

- **[Basic Usage](DOCS.md#doc-cookbooks-basic-usage)** - Validation, formatting, and the fluent API
- **[Custom Handlers](DOCS.md#doc-cookbooks-custom-handlers)** - Creating and registering country handlers
- **[Exception Handling](DOCS.md#doc-cookbooks-exception-handling)** - Handling validation errors gracefully
- **[Laravel Integration](DOCS.md#doc-cookbooks-laravel-integration)** - Validation rules, casts, Blade, and Livewire

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/postal-code/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [Benjamin Morel](https://github.com/brick/postcode)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance88

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

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 ~8 days

Total

14

Last Release

61d ago

Major Versions

1.x-dev → 2.0.02026-03-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (11 commits)")

---

Tags

phplaravelvalidationformattingzip codepostcodepostal-code

### Embed Badge

![Health badge](/badges/cline-postal-code/health.svg)

```
[![Health](https://phpackages.com/badges/cline-postal-code/health.svg)](https://phpackages.com/packages/cline-postal-code)
```

###  Alternatives

[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[galahad/laravel-addressing

Laravel package providing addressing functionality

70316.6k](/packages/galahad-laravel-addressing)[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)[iamfarhad/validation

🇮🇷 Complete Laravel Persian validation package - Iranian national ID, mobile numbers, Shamsi dates, IBAN/Sheba, postal codes &amp; more. Modern Laravel 10-12 support with both ValidationRule objects &amp; string-based rules.

2917.3k](/packages/iamfarhad-validation)

PHPackages © 2026

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