PHPackages                             slashlab/numerik - 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. slashlab/numerik

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

slashlab/numerik
================

Modern PHP 8.3+ library for validating and parsing Polish identification numbers (PESEL, NIP, REGON, KRS, NRB, VAT-EU, IBAN, ID Card, Passport).

v1.1.0(2mo ago)12.0k↑1462.5%1MITPHPPHP ^8.3CI passing

Since Apr 18Pushed 4w ago1 watchersCompare

[ Source](https://github.com/Sqrcz/numerik)[ Packagist](https://packagist.org/packages/slashlab/numerik)[ RSS](/packages/slashlab-numerik/feed)WikiDiscussions main Synced 3w ago

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

Numerik
=======

[](#numerik)

[![Tests](https://github.com/sqrcz/numerik/actions/workflows/tests.yml/badge.svg)](https://github.com/sqrcz/numerik/actions/workflows/tests.yml)[![PHPStan](https://camo.githubusercontent.com/d18b9a987aa81e64470a11caecf72caa66597c9ebd6b307bd1c2cb7a752b0dff/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c25323031302d627269676874677265656e2e737667)](https://phpstan.org)[![Latest Version](https://camo.githubusercontent.com/13ebbb6c2fce1485352f510fca92ff61c62e1ccb4f0a7967e6249511d294e4f2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c6173686c61622f6e756d6572696b2e737667)](https://packagist.org/packages/slashlab/numerik)[![PHP Version](https://camo.githubusercontent.com/ec879b4a99d52fef18b0a4530e6a927f62696063fda91d2f2bc128e9c5eeff34/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736c6173686c61622f6e756d6572696b2e737667)](https://packagist.org/packages/slashlab/numerik)[![License](https://camo.githubusercontent.com/dc9d6a637190b23162f24f11a5402b1f49329b8af4f92549c995259582e0b2b3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f737172637a2f6e756d6572696b2e737667)](LICENSE)[![CodeRabbit](https://camo.githubusercontent.com/c6e75a2d67d0d29458339efa097181bfabb60de498ac8c2289aa48d71d2ef64a/68747470733a2f2f696d672e736869656c64732e696f2f636f64657261626269742f7072732f6769746875622f737172637a2f6e756d6572696b)](https://coderabbit.ai)

> Modern PHP 8.3+ library for validating and parsing Polish identification numbers — PESEL, NIP, REGON, KRS, NRB, VAT-EU, IBAN, ID Card, and Passport. Rich value objects, detailed error reasons, zero production dependencies.

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

[](#installation)

```
composer require slashlab/numerik
```

Quick Start
-----------

[](#quick-start)

```
use SlashLab\Numerik\Numerik;

// Simple boolean check
Numerik::pesel()->isValid('92060512186');  // true
Numerik::nip()->isValid('5260250274');     // true

// Rich validation result with failure reasons
$result = Numerik::pesel()->validate('92060512185');  // wrong checksum digit
$result->isFailed();                       // true
$result->getFirstFailure()->reason;        // ValidationFailureReason::InvalidChecksum

// Parse to value object
$pesel = Numerik::pesel()->parse('92060512186');
$pesel->getBirthDate()->format('Y-m-d');  // '1992-06-05'
$pesel->getGender();                      // Gender::Female

// Try-parse — returns null on failure instead of throwing
$nip = Numerik::nip()->tryParse('5260250274');
$nip?->getFormatted();                     // '526-025-02-74'
```

Strict Mode
-----------

[](#strict-mode)

All identifiers accept an optional `strict` parameter (default `true`). In non-strict mode, formatting variations such as spaces and dashes are accepted:

```
Numerik::nip(strict: false)->isValid('526 025 02 74');  // true
Numerik::nip(strict: true)->isValid('526 025 02 74');   // false
```

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

[](#documentation)

Full documentation at **[numerik.slashlab.pl](https://numerik.slashlab.pl)**

JavaScript / TypeScript Port
----------------------------

[](#javascript--typescript-port)

A TypeScript port is available at [`@slashlab/numerik-js`](https://github.com/sqrcz/numerik-js). It mirrors this library's API — same identifiers, same value objects, same strict mode — with Zod integration included.

```
npm install @slashlab/numerik-js
```

Laravel Integration
-------------------

[](#laravel-integration)

A dedicated Laravel package is available at [`slashlab/numerik-laravel`](https://github.com/sqrcz/numerik-laravel) (PHP 8.3+, Laravel 12/13). It provides class-based and string-based validation rules with per-failure-reason error messages, English and Polish translations, and extended `PeselRule` constraints (`gender`, `bornBefore`, `bornAfter`).

```
composer require slashlab/numerik-laravel
```

See the [numerik-laravel README](https://github.com/sqrcz/numerik-laravel#readme) for full usage.

Changelog
---------

[](#changelog)

See [CHANGELOG.md](CHANGELOG.md).

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

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md).

Security
--------

[](#security)

See [SECURITY.md](SECURITY.md).

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

---

If this saved you time → [☕ Buy me a coffee](https://buymeacoffee.com/sqrcz)

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance90

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.6% 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 ~19 days

Total

2

Last Release

78d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ce016189edb1edd4fca9ad72432e18cd5956e41f0a74760a455a1344e04b880?d=identicon)[Sqrcz](/maintainers/Sqrcz)

---

Top Contributors

[![Sqrcz](https://avatars.githubusercontent.com/u/2791138?v=4)](https://github.com/Sqrcz "Sqrcz (71 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

ibanid-cardkrslaravelnipnrbpassportpeselphpphp83polandpolishregonvalidationvat-euvalidatorvalidationregonnipkrspeselpolishpolandnumerik

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/slashlab-numerik/health.svg)

```
[![Health](https://phpackages.com/badges/slashlab-numerik/health.svg)](https://phpackages.com/packages/slashlab-numerik)
```

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

6.0k39.9M418](/packages/respect-validation)[opis/json-schema

Json Schema Validator for PHP

65543.6M320](/packages/opis-json-schema)[vlucas/valitron

Simple, elegant, stand-alone validation library with NO dependencies

1.7k4.6M142](/packages/vlucas-valitron)[intervention/validation

Additional validation rules for the Laravel framework

6827.2M20](/packages/intervention-validation)[proengsoft/laravel-jsvalidation

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

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)[wixel/gump

A fast, extensible &amp; stand-alone PHP input validation class that allows you to validate any data.

1.2k1.4M33](/packages/wixel-gump)

PHPackages © 2026

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