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(3mo ago)04.2k↓25.4%1MITPHPPHP ^8.5.0CI passing

Since Dec 30Pushed 3mo 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 3d 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

46

—

FairBetter than 92% of packages

Maintenance79

Regular maintenance activity

Popularity24

Limited adoption so far

Community10

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

108d 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

3893.6M1](/packages/axlon-laravel-postal-code-validation)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.9k3](/packages/defstudio-telegraph)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[harris21/laravel-fuse

Circuit breaker for Laravel queue jobs. Protect your workers from cascading failures.

44855.7k](/packages/harris21-laravel-fuse)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)

PHPackages © 2026

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