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.

v1.3.0(1mo ago)159↑183.3%MITPHPPHP ^8.3CI passing

Since Apr 27Pushed 1mo agoCompare

[ 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 1w ago

READMEChangelog (4)Dependencies (7)Versions (8)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)[![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)

> 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 11, 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
```

### 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

Community6

Small or concentrated contributor base

Maturity53

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 ~3 days

Total

4

Last Release

31d 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 (36 commits)")

---

Tags

ibanid-cardkrslaravelnipnrbpassportpeselphpphp83polandpolishregonvalidationvat-eularavelvalidationregonnipkrspeselpolishpolandnumerik

###  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

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k38.3M138](/packages/propaganistas-laravel-phone)[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)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

762621.7k17](/packages/wendelladriel-laravel-validated-dto)[prettus/laravel-validation

Laravel Validation Service

42011.2M52](/packages/prettus-laravel-validation)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2462.3M6](/packages/laravel-validation-rules-credit-card)

PHPackages © 2026

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