PHPackages                             calatoiu/cnpcui-rule - 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. calatoiu/cnpcui-rule

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

calatoiu/cnpcui-rule
====================

A Laravel validation rule to validate CNPCUI numbers

1.0.1(2y ago)023↓100%MITPHPPHP ^8.1

Since Apr 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/calatoiu/cnpcui-rule)[ Packagist](https://packagist.org/packages/calatoiu/cnpcui-rule)[ Docs](https://github.com/calatoiu/cnpcui-rule)[ RSS](/packages/calatoiu-cnpcui-rule/feed)WikiDiscussions main Synced 1mo ago

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

🏦 CNPCUI Validation Rule for Laravel
------------------------------------

[](#-cnpcui-validation-rule-for-laravel)

[![GitHub](https://camo.githubusercontent.com/722bca06f595a52032f8aff177c493f1e83118731cdc99c95d0e4a0112430849/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f63616c61746f69752f636e706375692d72756c653f7374796c653d666c61742d737175617265)](LICENSE)[![GitHub issues](https://camo.githubusercontent.com/ee1f979f7d50b375067c500adbacaa7747c05961188806e870376c7faedb7e47/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f63616c61746f69752f636e706375692d72756c653f7374796c653d666c61742d737175617265)](Issues)[![Packagist Downloads](https://camo.githubusercontent.com/f026a18b2a379cba509514254d28b8d08e3f07027978cfdc9db6038669bac70a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616c61746f69752f636e706375692d72756c653f7374796c653d666c61742d737175617265)](Downloads)[![GitHub Release](https://camo.githubusercontent.com/5754d16f27a66a01ef343d57baae8c4baada986c3d0ca197d14024552432b352/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f63616c61746f69752f636e706375692d72756c653f7374796c653d666c61742d737175617265)](Release)

This package provides a custom validation rule for Laravel to validate (CNPCUIs).

### 🧰 Requirements

[](#-requirements)

- `PHP >= 8.1`
- `Laravel >= 10`

### ⚙️ Installation

[](#️-installation)

You can install this package using Composer:

`composer require calatoiu/cnpcui-rule`

### 👾 Usage

[](#-usage)

To use the CNPCUI validation rule, simply add it to your Laravel validation rules. Here's an example:

```
use Illuminate\Http\Request;
use calatoiu\CnpcuiRule\ValidCnpcui;

public function store(Request $request)
{
    $request->validate([
        'cnpcui' => ['required', new ValidCnpcui()],
    ]);

    // The rest of your code
}
```

### 👽 Customize error message

[](#-customize-error-message)

You can use your own validation message (by default will be `The :attribute is not a valid CNPCUI.`).

> ⚠️ **If you don't have these folders** use `php artisan lang:publish`

Simply:

```
# Path
\main_folder_project
    \lang
        \app_language(ex.'en')
            validation.php

# Add 'cnpcui' key
 'CNPCUI non valido.'

# Now you're validation message will be translated!
```

### 🤝 Contribution

[](#-contribution)

If you find any issues or have suggestions for improvements, feel free to open a pull request or issue. Your contribution is highly appreciated.

### 🔨 Test

[](#-test)

`composer test`

### 📝 License

[](#-license)

This package is open-sourced software licensed under the [MIT license](https://github.com/calatoiu/cnpcui-rule/blob/main/LICENSE.md).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

750d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b92e4e2700be42741b3a0a9018cbf525602f83ea2a6803b9cfabd4963fb249de?d=identicon)[calatoiu](/maintainers/calatoiu)

---

Top Contributors

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

---

Tags

laravelvalidationrulecalatoiucnpcui-rule

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/calatoiu-cnpcui-rule/health.svg)

```
[![Health](https://phpackages.com/badges/calatoiu-cnpcui-rule/health.svg)](https://phpackages.com/packages/calatoiu-cnpcui-rule)
```

###  Alternatives

[propaganistas/laravel-phone

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

3.0k35.7M106](/packages/propaganistas-laravel-phone)[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[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)

PHPackages © 2026

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