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

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

beastbytes/postal-code-validator
================================

Postal code validator

1.0.0(1y ago)09BSD-3-ClausePHPPHP ^8.1

Since Oct 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/beastbytes/postal-code-validator)[ Packagist](https://packagist.org/packages/beastbytes/postal-code-validator)[ RSS](/packages/beastbytes-postal-code-validator/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

Postal Code Validator (postal-code-validator)
=============================================

[](#postal-code-validator-postal-code-validator)

Provides validation for postal codes.

Postal codes can be validated against a single country or a list of countries.

A postalCodeDataInterface implementation is also required, e.g. beastbytes/postal-code-data-php

**NOTE:** postal-code-validator does ***not*** guarantee that a postal code exists only that it is in a valid format. For some countries that is - for example - it has the right number of digits, characters in the right place etc. However, for many the validator also checks that disallowed characters are not used, number ranges are correct, etc. If you can improve validation for a country please submit a pull request.

For license information see the [LICENSE](LICENSE.md) file.

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist beastbytes/postal-code-validator

```

or add

```
"beastbytes/postal-code-validator": "^1.0.0"
```

to the "require" section of your composer.json.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

634d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b0b5133b5137b26eeb25056449c28364ac0af31836eefba78912a9c8f0743aa3?d=identicon)[BeastBytes](/maintainers/BeastBytes)

---

Top Contributors

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

---

Tags

postal-codevalidatoryii3validatorpostal-code

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

6.0k39.9M413](/packages/respect-validation)[seld/jsonlint

JSON Linter

1.3k228.7M272](/packages/seld-jsonlint)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k193.5M40](/packages/composer-spdx-licenses)[opis/json-schema

Json Schema Validator for PHP

65243.6M300](/packages/opis-json-schema)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15848.2M222](/packages/laminas-laminas-validator)[barbieswimcrew/zip-code-validator

Constraint class for international zipcode validation

772.5M](/packages/barbieswimcrew-zip-code-validator)

PHPackages © 2026

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