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(1mo ago)0564↑500%[1 PRs](https://github.com/Sqrcz/numerik/pulls)1MITPHPPHP ^8.3CI passing

Since Apr 18Pushed 3w agoCompare

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

READMEChangelog (2)Dependencies (5)Versions (4)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('92060512186');
$result->isValid;                          // true

$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
```

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

[](#documentation)

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

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

[](#laravel-integration)

A dedicated Laravel package is available at [`slashlab/numerik-laravel`](https://github.com/Sqrcz/numerik-laravel) (requires PHP 8.3+, Laravel 11/12/13). The service provider is auto-discovered — no manual registration needed.

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

Use class-based rules or plain strings — both styles work:

```
// Personal
use SlashLab\NumerikLaravel\Rules\PeselRule;
use SlashLab\NumerikLaravel\Rules\IdCardRule;
use SlashLab\NumerikLaravel\Rules\PassportRule;

// Tax & Business
use SlashLab\NumerikLaravel\Rules\NipRule;
use SlashLab\NumerikLaravel\Rules\VatEuRule;
use SlashLab\NumerikLaravel\Rules\RegonRule;
use SlashLab\NumerikLaravel\Rules\KrsRule;

// Banking
use SlashLab\NumerikLaravel\Rules\NrbRule;
use SlashLab\NumerikLaravel\Rules\IbanRule;

// Class-based (supports options)
public function rules(): array
{
    return [
        'pesel'    => ['required', new PeselRule()],              // strict mode on by default
        // 'pesel'  => ['required', new PeselRule(strict: false)], // disable strict checks
        'id_card'  => ['required', new IdCardRule()],
        'passport' => ['required', new PassportRule()],
        'nip'      => ['required', new NipRule()],
        'vat_eu'   => ['required', new VatEuRule()],
        'regon'    => ['required', new RegonRule()],
        'krs'      => ['required', new KrsRule()],
        'nrb'      => ['required', new NrbRule()],
        'iban'     => ['required', new IbanRule()],
    ];
}

// String-based
public function rules(): array
{
    return [
        'pesel'    => ['required', 'pesel'],
        'id_card'  => ['required', 'id_card'],
        'passport' => ['required', 'passport'],
        'nip'      => ['required', 'nip'],
        'vat_eu'   => ['required', 'vat_eu'],
        'regon'    => ['required', 'regon'],
        'krs'      => ['required', 'krs'],
        'nrb'      => ['required', 'nrb'],
        'iban'     => ['required', 'iban'],
    ];
}
```

Class-based rules return a distinct message per failure reason (e.g. wrong checksum vs invalid length). Messages resolve the field label from `validation.attributes` when available, falling back to a humanised field name. The package ships with English and Polish translations — publish them with `php artisan vendor:publish --tag=numerik-lang`.

`PeselRule` also accepts `gender`, `bornBefore`, and `bornAfter` constraints for stricter identity checks. See the [full Laravel documentation](https://numerik.slashlab.pl/integrations/laravel/) for details.

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

License
-------

[](#license)

MIT — see [LICENSE](LICENSE).

---

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

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance94

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.5% 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

33d 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 (66 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.1k39.0M405](/packages/respect-validation)[opis/json-schema

Json Schema Validator for PHP

64841.2M257](/packages/opis-json-schema)[vlucas/valitron

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

1.6k4.6M135](/packages/vlucas-valitron)[intervention/validation

Additional validation rules for the Laravel framework

6777.1M18](/packages/intervention-validation)[proengsoft/laravel-jsvalidation

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

1.1k2.3M50](/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.4M31](/packages/wixel-gump)

PHPackages © 2026

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