PHPackages                             pacerit/laravel-polish-validation-rules - 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. pacerit/laravel-polish-validation-rules

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

pacerit/laravel-polish-validation-rules
=======================================

Simple Polish Validation rules for Laravel and Lumen framework

8.0.0(1y ago)1449.9k↓23.6%5[1 PRs](https://github.com/pacerit/laravel-polish-validation-rules/pulls)MITPHPPHP ^8.2

Since Aug 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pacerit/laravel-polish-validation-rules)[ Packagist](https://packagist.org/packages/pacerit/laravel-polish-validation-rules)[ RSS](/packages/pacerit-laravel-polish-validation-rules/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (50)Used By (0)

Laravel Polish Validation Rules
===============================

[](#laravel-polish-validation-rules)

[![GitHub tag (latest by date)](https://camo.githubusercontent.com/5c7629d8642c21c063ebd6e3ccec0d1fc4700b70138527311859f8e4fa05c0be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672d646174652f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d56657273696f6e)](https://camo.githubusercontent.com/5c7629d8642c21c063ebd6e3ccec0d1fc4700b70138527311859f8e4fa05c0be/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672d646174652f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d56657273696f6e)[![GitHub](https://camo.githubusercontent.com/279b0554f7b36eadb398dc7731039bacf2a18761da9d2358967eff851ae1bcaa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d4c6963656e7365)](https://camo.githubusercontent.com/279b0554f7b36eadb398dc7731039bacf2a18761da9d2358967eff851ae1bcaa/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d4c6963656e7365)[![Packagist](https://camo.githubusercontent.com/9fda65034b82b1a7e52598280f7e63a6014036caa48ae7c4b6347d4feca2e58a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d446f776e6c6f616473)](https://camo.githubusercontent.com/9fda65034b82b1a7e52598280f7e63a6014036caa48ae7c4b6347d4feca2e58a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d446f776e6c6f616473)[![PHP from Packagist](https://camo.githubusercontent.com/576ff35d3f9e5e297757df5e2c0e4476fc5be6790664259b8987cbebe9235d0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d504850)](https://camo.githubusercontent.com/576ff35d3f9e5e297757df5e2c0e4476fc5be6790664259b8987cbebe9235d0f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65733f6c6162656c3d504850)[![StyleCI](https://camo.githubusercontent.com/d7d3d912b5b737302f6cb980f891798c8d39d4aeaeecf188a84bf2e48b7bafcf/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3230313931323636342f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/201912664)[![](https://camo.githubusercontent.com/a4706b038501de65f826568f178ab6a91fd194d0e4521778da0f6895bcaa8762/68747470733a2f2f636972636c6563692e636f6d2f67682f706163657269742f6c61726176656c2d706f6c6973682d76616c69646174696f6e2d72756c65732e7376673f7374796c653d737667)](https://circleci.com/gh/pacerit/laravel-polish-validation-rules)

Simple Polish Validation rules for Laravel and Lumen framework

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

[](#installation)

You can install this package by composer:

```
composer require pacerit/laravel-polish-validation-rules

```

For customize validaiton messages run:

```
php artisan vendor:publish --provider "PacerIT\LaravelPolishValidationRules\Providers\LaravelPolishValidationRulesServiceProvider"

```

### Version compatibility

[](#version-compatibility)

#### Laravel/Lumen

[](#laravellumen)

FrameworkPackageNote5.8.x^1.x.xNo longer maintained.6.0.x^2.x.xNo longer maintained.7.x.x^3.x.xNo longer maintained.8.x.x^4.x.xPHP ^8.0 Supported from 4.0.3, Bug fixes only. No longer maintained.9.x.x^5.x.x10.x.x^6.x.x11.x.x^7.x.x12.x.x^8.x.xRules
-----

[](#rules)

1. 'PESEL' - validate [PESEL](https://pl.wikipedia.org/wiki/PESEL) number. We can validate additional parameters:
    - Gender - check if gender value in PESEL
        - `gender_male`
        - `gender_female`
    - Birth date - checking if birth date decoded from PESEL number is before or after date defined in rules
        - `born_before,Y-m-d` - i.e. `PESEL:born_before,2022-01-01`
        - `born_after,Y-m-d` - i.e. `PESEL:born_after,2000-01-01`
2. 'REGON' - validate [REGON](https://pl.wikipedia.org/wiki/REGON) number
3. 'NIP' - validate [NIP](https://pl.wikipedia.org/wiki/NIP) number
4. 'id\_card\_number' - validate Polish ID Card number
5. 'post\_code' - validate Polish post codes. By default accept codes in format 00-000 and 00000. You can change this with options:
    - with\_dash - only post codes with format 00-000 are valid
    - without\_dash - only post code with format 00000 are valid
6. 'PWZ' - validate PWZ (Prawo wykonywania zawodu lekarza/farmaceuty) numer (more information [HERE](https://nil.org.pl/rejestry/centralny-rejestr-lekarzy/zasady-weryfikowania-nr-prawa-wykonywania-zawodu))
7. 'passport\_number' - validate Polish passport number

Usage example
-------------

[](#usage-example)

Without optional parameters

```
$validator = Validator::make(
    $request->all(),
    [
        'post_code'  => 'post_code',
        'pesel'      => 'PESEL',
        'nip_number' => 'NIP',
    ]
);
```

With optional parameters

```
$validator = Validator::make(
    $request->all(),
    [
        'post_code' => 'post_code:without_dash',
        'pesel'     => 'PESEL:gender_female',
    ]
);
```

Multiple options

```
$validator = Validator::make(
    $request->all(),
    [
        'pesel' => 'PESEL:gender_male:born_before,2022-01-01:born_after,2000-01-01',
    ]
);
```

Code Authors
------------

[](#code-authors)

The algorithms used in the functions are based on existing solutions. Below are links to the sources:

- PESEL
    - checksum checking algorithm -
    - extract/validate bith date - [KKSzymanowski/PESEL](https://github.com/KKSzymanowski/PESEL/blob/master/src/Pesel.php)
- REGON -
- NIP -
- id\_card\_number - [http://www.algorytm.org](http://www.algorytm.org/numery-identyfikacyjne/numer-dowodu-osobistego/do-php.html)

Changelog
---------

[](#changelog)

Go to the [Changelog](CHANGELOG.md) for a full change history of the package.

Testing
-------

[](#testing)

```
composer test

```

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within package, please send an e-mail to Wiktor Pacer via . All security vulnerabilities will be promptly addressed.

License
-------

[](#license)

This package is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance45

Moderate activity, may be stable

Popularity39

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 95.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 ~52 days

Recently: every ~164 days

Total

40

Last Release

434d ago

Major Versions

2.0.x-dev → 5.0.02022-02-15

4.1.0 → 5.0.12022-06-20

4.x-dev → 6.0.02023-03-31

5.x-dev → 7.0.02024-05-05

7.x-dev → 8.0.02025-03-11

PHP version history (7 changes)1.0.0PHP ^7.1

2.0.0PHP ^7.2

4.0.0PHP ^7.3

4.0.3PHP ^7.3|^8.0

5.0.0PHP ^8.0

6.0.0PHP ^8.1

7.0.0PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/53344063?v=4)[Wiktor Pacer](/maintainers/WiktorPacer)[@WiktorPacer](https://github.com/WiktorPacer)

---

Top Contributors

[![WiktorPacer](https://avatars.githubusercontent.com/u/53344063?v=4)](https://github.com/WiktorPacer "WiktorPacer (64 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")[![mhajder](https://avatars.githubusercontent.com/u/6783135?v=4)](https://github.com/mhajder "mhajder (1 commits)")[![wbaryla](https://avatars.githubusercontent.com/u/49790363?v=4)](https://github.com/wbaryla "wbaryla (1 commits)")

---

Tags

card-numberid-cardid-card-numberlaravellumenlumen-frameworknippassport-numberpeselphppolishpolish-passport-numberpolish-validationpost-codepwzpwz-numberregonvalidationvalidation-ruleslaravelvalidationregonpeselpolishpacerit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pacerit-laravel-polish-validation-rules/health.svg)

```
[![Health](https://phpackages.com/badges/pacerit-laravel-polish-validation-rules/health.svg)](https://phpackages.com/packages/pacerit-laravel-polish-validation-rules)
```

###  Alternatives

[propaganistas/laravel-phone

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

3.0k35.7M107](/packages/propaganistas-laravel-phone)[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

759569.4k13](/packages/wendelladriel-laravel-validated-dto)[laravel-validation-rules/credit-card

Validate credit card number, expiration date, cvc

2412.2M5](/packages/laravel-validation-rules-credit-card)[illuminatech/validation-composite

Allows uniting several validation rules into a single one for easy re-usage

184485.5k](/packages/illuminatech-validation-composite)

PHPackages © 2026

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