PHPackages                             tomasz-kr/pesel - 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. tomasz-kr/pesel

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

tomasz-kr/pesel
===============

Obiekt PESEL, możliwość: walidacji, ustawienie zakresu roku poprawnych peseli, wyciągnięcia danych jakie znajdują się m.in data urodzenia, płeć

2.0.0(3y ago)1835MITPHPPHP 8.\*CI failing

Since Oct 30Pushed 3y ago2 watchersCompare

[ Source](https://github.com/TomaszKr/Pesel)[ Packagist](https://packagist.org/packages/tomasz-kr/pesel)[ RSS](/packages/tomasz-kr-pesel/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Pesel
=====

[](#pesel)

Object Pesel PESEL mean Personal Identificator for Poland

[![Build Status](https://camo.githubusercontent.com/8ff775f8e001956d4a529c58493ff48bfe2c580071d8451cad23717b29a7a96c/68747470733a2f2f7472617669732d63692e6f72672f546f6d61737a4b722f506573656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/TomaszKr/Pesel)

Getting Started
---------------

[](#getting-started)

Used this object for every time when your project has number PESEL and you must validation it.

### Required

[](#required)

```
PHP >= 7.1

```

### Installing

[](#installing)

Go to your project directory where the `composer.json` file is located and type:

```
composer install tomasz-kr/pesel

```

Running the tests
-----------------

[](#running-the-tests)

```
phpunit --configuration phpunit.xml

```

Overview
--------

[](#overview)

Firstly, create object Pesel and add in constructor number Pesel:

```
$pesel = new PESEL("NUMBER");

```

Now, you can take information about:

- Correct format

```
$pesel->isCorrectLenght(); //boolean

```

- Correct only number

```
$pesel->isCorrectNumber(); //boolean

```

- Correct for number controls

```
$pesel->valid(); //boolean

```

- Correct for exist in this day

```
$pesel->isCorrectDateNow();

```

- Correct for all condition

```
$pesel->isCorrect(); //boolean

```

- Birthday

```
$pesel->getBirthday()->format("Y-m-d");

```

- Gender

```
$pesel->setTextForMan("Man");
$pesel->setTextForWoman("Woman");
$pesel->whatGender(); //return man or woman

```

- Correct year between 2 years (min and max)

```
$pesel->isCorrectYear(); //boolean

```

Default:

> Min has 1st January 1800

> Max has this days

- Set max year

```
$pesel->setMaxYear(\DateTime $dateTime);

```

- Set min year

```
$pesel->setMinYear(\DateTime $dateTime);

```

Author
------

[](#author)

[Tomasz Król](http://tomaszkrol.eu)

License
-------

[](#license)

This project is licensed under the MIT Licence - see the [LICENSE](LICENSE.md) file for details

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

1179d ago

Major Versions

1.0.0 → 2.0.02023-02-18

PHP version history (2 changes)1.0.0PHP &gt;=7.1

2.0.0PHP 8.\*

### Community

Maintainers

![](https://www.gravatar.com/avatar/8239b707ca06663d066508a5e3a01ef62921d8103103f9d664b0a93a280c8a51?d=identicon)[TomaszKr](/maintainers/TomaszKr)

---

Top Contributors

[![TomaszKr](https://avatars.githubusercontent.com/u/11741908?v=4)](https://github.com/TomaszKr "TomaszKr (19 commits)")

---

Tags

number-peselooppeselphpphp71validationphpvalidationpesel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tomasz-kr-pesel/health.svg)

```
[![Health](https://phpackages.com/badges/tomasz-kr-pesel/health.svg)](https://phpackages.com/packages/tomasz-kr-pesel)
```

###  Alternatives

[yorcreative/laravel-argonaut-dto

Argonaut is a lightweight Data Transfer Object (DTO) package for Laravel that supports nested casting, recursive serialization, and validation out of the box. Ideal for service layers, APIs, and clean architecture workflows.

1062.8k1](/packages/yorcreative-laravel-argonaut-dto)[pacerit/laravel-polish-validation-rules

Simple Polish Validation rules for Laravel and Lumen framework

1449.9k](/packages/pacerit-laravel-polish-validation-rules)

PHPackages © 2026

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