PHPackages                             laravel-liberu/cnp-validator - 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. laravel-liberu/cnp-validator

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

laravel-liberu/cnp-validator
============================

Romanian CNP validator for Laravel

v9.0.2(4y ago)02MITPHPPHP &gt;=8.0

Since Mar 21Pushed 2y ago1 watchersCompare

[ Source](https://github.com/laravel-liberu/cnp-validator)[ Packagist](https://packagist.org/packages/laravel-liberu/cnp-validator)[ Docs](https://github.com/laravel-enso/CnpValidator)[ RSS](/packages/laravel-liberu-cnp-validator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (52)Used By (0)

CNP Validator
=============

[](#cnp-validator)

[![Codacy Badge](https://camo.githubusercontent.com/846a52fa961d040790303f9367411424afbf94dbd103452386cb7c62213d3426/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3931663566386432363633333433326462333564396365623730353831353133)](https://www.codacy.com/gh/laravel-liberu/cnp-validator?utm_source=github.com&utm_medium=referral&utm_content=laravel-liberu/cnp-validator&utm_campaign=Badge_Grade)[![StyleCI](https://camo.githubusercontent.com/f2805f67e553f54d59086e35ca97b2f75677a248437bafe62f62db2b4878e197/68747470733a2f2f7374796c6563692e696f2f7265706f732f38353637353534322f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/85675542)[![License](https://camo.githubusercontent.com/4fd1b3168bf2fb8f3e25f3e58b5b050133d4296b24062bcee97e5319aaf31f97/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6c69626572752f616374696f6e6c6f676765722f6c6963656e7365)](https://packagist.org/packages/laravel-liberu/actionlogger)[![Total Downloads](https://camo.githubusercontent.com/59287545a8f80f5c93f102c3a5595c3fcd020d8cbf180c8e7454e5057d8f11f6/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6c69626572752f636e702d76616c696461746f722f646f776e6c6f616473)](https://packagist.org/packages/laravel-liberu/cnp-validator)[![Latest Stable Version](https://camo.githubusercontent.com/054199b52fb0c49b57ec965669900803cfda9a666596d7ec67761eb815aa27ec/68747470733a2f2f706f7365722e707567782e6f72672f6c61726176656c2d6c69626572752f636e702d76616c696461746f722f76657273696f6e)](https://packagist.org/packages/laravel-liberu/cnp-validator)

Romanian CNP validator for Laravel

### Instalation Steps

[](#instalation-steps)

1. Add `'LaravelLiberu\CnpValidator\CnpValidatorServiceProvider::class'` to your providers list in config/app.php.
2. Use the CNP validator in your ValidateModelRequest validation class

    ```
    public function rules()
    {
        return [
            'cnp' => [
                    'max:13',
                    'cnp',
                    'nullable',
                    request()->getMethod() == 'PATCH'
                        ? Rule::unique('users', 'nin')->ignore(route('user')->id)
                        : Rule::unique('users', 'nin')
                ],
        ];
    }

    ```

### Notes

[](#notes)

Don't forget to add the translation for the validator error message in `resources/lang/**/validation.php` under the `cnp` key.

The [Laravel Liberu Core](https://github.com/laravel-liberu/Core) package comes with this package included.

### Contributions

[](#contributions)

are welcome. Pull requests are great, but issues are good too.

### License

[](#license)

This package is released under the MIT license.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~37 days

Total

51

Last Release

943d ago

Major Versions

1.4.3 → 2.0.02020-06-23

2.0.3 → v9.0.22022-03-04

v2.1.1 → 3.0.02023-03-21

PHP version history (4 changes)1.0.0PHP &gt;=5.6.4

1.3.1PHP &gt;=7.1.0

1.4.0PHP &gt;=7.4.0

2.0.2PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/179251?v=4)[Curtis Delicata](/maintainers/curtisdelicata)[@curtisdelicata](https://github.com/curtisdelicata)

---

Top Contributors

[![aocneanu](https://avatars.githubusercontent.com/u/16073274?v=4)](https://github.com/aocneanu "aocneanu (11 commits)")[![gandesc](https://avatars.githubusercontent.com/u/14071925?v=4)](https://github.com/gandesc "gandesc (7 commits)")[![curtisdelicata](https://avatars.githubusercontent.com/u/179251?v=4)](https://github.com/curtisdelicata "curtisdelicata (6 commits)")[![vmcvlad](https://avatars.githubusercontent.com/u/37445394?v=4)](https://github.com/vmcvlad "vmcvlad (2 commits)")[![DevIonut](https://avatars.githubusercontent.com/u/19207797?v=4)](https://github.com/DevIonut "DevIonut (2 commits)")[![raftx24](https://avatars.githubusercontent.com/u/10864136?v=4)](https://github.com/raftx24 "raftx24 (2 commits)")[![GITmanuela](https://avatars.githubusercontent.com/u/44998004?v=4)](https://github.com/GITmanuela "GITmanuela (1 commits)")[![ottoszika](https://avatars.githubusercontent.com/u/7945963?v=4)](https://github.com/ottoszika "ottoszika (1 commits)")

---

Tags

laravellaravel10phpphp8laravelvalidatorCNPlaravel-ensocnp-validator

### Embed Badge

![Health badge](/badges/laravel-liberu-cnp-validator/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-liberu-cnp-validator/health.svg)](https://phpackages.com/packages/laravel-liberu-cnp-validator)
```

###  Alternatives

[illuminatech/validation-composite

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

184485.5k](/packages/illuminatech-validation-composite)[stuyam/laravel-phone-validator

A phone validator for Laravel using the free Twilio phone lookup service.

2861.3k](/packages/stuyam-laravel-phone-validator)[laravel-validation-rules/us-state

Validate US States and Canada Provinces

16172.7k](/packages/laravel-validation-rules-us-state)[laravel-validation-rules/timezone

Validate that a given timezone is valid.

2119.0k](/packages/laravel-validation-rules-timezone)

PHPackages © 2026

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