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

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

slashlab/numerik-laravel
========================

Laravel validation rules for Polish identification numbers (PESEL, NIP, REGON, KRS, ID card, passport, VAT-EU, NRB, IBAN) — powered by slashlab/numerik.

v2.0.0(4w ago)191↑112.5%MITPHPPHP ^8.3CI passing

Since Apr 27Pushed 4w ago1 watchersCompare

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

READMEChangelog (5)Dependencies (14)Versions (9)Used By (0)

numerik-laravel
===============

[](#numerik-laravel)

[![Tests](https://github.com/sqrcz/numerik-laravel/actions/workflows/tests.yml/badge.svg)](https://github.com/sqrcz/numerik-laravel/actions/workflows/tests.yml)[![PHPStan](https://camo.githubusercontent.com/d18b9a987aa81e64470a11caecf72caa66597c9ebd6b307bd1c2cb7a752b0dff/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c25323031302d627269676874677265656e2e737667)](https://phpstan.org)[![Latest Version](https://camo.githubusercontent.com/d3ff9a177f5c7c12c4cb4b2e4531ce4cf09ba207c2d19d505d19f51d232244da/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736c6173686c61622f6e756d6572696b2d6c61726176656c2e737667)](https://packagist.org/packages/slashlab/numerik-laravel)[![PHP Version](https://camo.githubusercontent.com/a2cfe7ba1e32731e40f15496283664ed61b857096714242701aab9ca28070e7e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736c6173686c61622f6e756d6572696b2d6c61726176656c2e737667)](https://packagist.org/packages/slashlab/numerik-laravel)[![License](https://camo.githubusercontent.com/799af1bb7547d7289548fc30df98e92eec5d7637a1bb37de080c689714eefc23/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f737172637a2f6e756d6572696b2d6c61726176656c2e737667)](LICENSE)[![CodeRabbit](https://camo.githubusercontent.com/2e6e063b34faf49e44f25937ec35a1bcaa48b3c8bc2b60071eac5338010807d9/68747470733a2f2f696d672e736869656c64732e696f2f636f64657261626269742f7072732f6769746875622f737172637a2f6e756d6572696b2d6c61726176656c)](https://coderabbit.ai)

> Laravel validation rules for Polish identification numbers — PESEL, NIP, REGON, KRS, ID card, passport, VAT-EU, NRB, and IBAN. Powered by [slashlab/numerik](https://github.com/sqrcz/numerik).

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

[](#requirements)

- PHP 8.3+
- Laravel 12 or 13

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

[](#installation)

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

The service provider is auto-discovered — no manual registration needed.

Usage
-----

[](#usage)

### Validation rules

[](#validation-rules)

Use the rules in form requests or `Validator::make()` calls:

```
// 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;

public function rules(): array
{
    return [
        'pesel'   => ['required', new PeselRule()],
        '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()],
    ];
}
```

### Strict mode

[](#strict-mode)

All rules accept an optional `strict` parameter (default `true`). In strict mode, PESELs with future birth dates or all-identical digits are rejected:

```
new PeselRule(strict: false)
```

### Validation messages

[](#validation-messages)

Class-based rules return a specific message for each failure reason — for example, a NIP with a wrong checksum digit returns a different message than one with an invalid length.

Error messages use the field label registered in `validation.attributes` when one is found, matching the behaviour of Laravel's built-in rules. If no label is registered, the field name is humanised (underscores replaced with spaces, first letter capitalised).

The package ships with **English** (`en`) and **Polish** (`pl`) translations. To publish and customise them:

```
php artisan vendor:publish --tag=numerik-lang
```

### PeselRule constraints

[](#peselrule-constraints)

`PeselRule` accepts additional parameters for stricter identity checks:

```
new PeselRule(
    gender: Gender::Female,
    bornBefore: new DateTimeImmutable('2000-01-01'),
    bornAfter: new DateTimeImmutable('1980-01-01'),
)
```

All parameters are optional and can be combined freely.

### String-based rules

[](#string-based-rules)

Rules are also available as strings via the service provider:

```
// Personal
'pesel'    => ['required', 'pesel'],
'id_card'  => ['required', 'id_card'],
'passport' => ['required', 'passport'],

// Tax & Business
'nip'    => ['required', 'nip'],
'vat_eu' => ['required', 'vat_eu'],
'regon'  => ['required', 'regon'],
'krs'    => ['required', 'krs'],

// Banking
'nrb'  => ['required', 'nrb'],
'iban' => ['required', 'iban'],
```

String-based rules always return a generic message regardless of the failure reason. Use the class-based rules when specific messages matter.

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

45

—

FairBetter than 91% of packages

Maintenance94

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~14 days

Total

5

Last Release

29d ago

Major Versions

v1.3.0 → v2.0.02026-06-25

### 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 (42 commits)")

---

Tags

ibanid-cardkrslaravelnipnrbpassportpeselphpphp83polandpolishregonvalidationvat-eularavelvalidationpassportIBANregonnipkrspeselpolishID Cardpolandnrbnumerikvat-eu

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[intervention/validation

Additional validation rules for the Laravel framework

6827.2M20](/packages/intervention-validation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel

3893.6M1](/packages/axlon-laravel-postal-code-validation)[proengsoft/laravel-jsvalidation

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

1.1k2.4M50](/packages/proengsoft-laravel-jsvalidation)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

772649.9k18](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2462.4M8](/packages/laravel-validation-rules-credit-card)[sandermuller/laravel-fluent-validation

Fluent validation rule builders for Laravel

20720.5k4](/packages/sandermuller-laravel-fluent-validation)

PHPackages © 2026

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