PHPackages                             pfrug/validate-document-uy - 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. pfrug/validate-document-uy

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

pfrug/validate-document-uy
==========================

Library to validate Uruguayan identity documents (CI numbers)

v3.0(1y ago)028MITPHPPHP ^8.2

Since Mar 20Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pfrug/validate-document-uy)[ Packagist](https://packagist.org/packages/pfrug/validate-document-uy)[ RSS](/packages/pfrug-validate-document-uy/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (4)Versions (4)Used By (0)

ValidateDocumentUy
==================

[](#validatedocumentuy)

A Laravel 11+ package for validating Uruguayan identity documents (Cédula de Identidad). Supports validation via rule class or shorthand string rule (`validate_ci`), includes localization support and random generation for testing.

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

[](#installation)

```
composer require pfrug/validate-document-uy
```

### Register the service provider

[](#register-the-service-provider)

In `bootstrap/app.php`:

```
use Pfrug\ValidateDocumentUy\Providers\ValidateDocumentUyServiceProvider;

->withProviders([
    ValidateDocumentUyServiceProvider::class,
])
```

---

Usage
-----

[](#usage)

### Validation via string rule

[](#validation-via-string-rule)

```
$request->validate([
    'document' => 'required|validate_ci',
]);
```

### Validation via rule class

[](#validation-via-rule-class)

```
use Pfrug\ValidateDocumentUy\Rules\ValidUruguayanCiRule;

$request->validate([
    'document' => ['required', new ValidUruguayanCiRule()],
]);
```

### Using the facade

[](#using-the-facade)

```
use Pfrug\ValidateDocumentUy\Facades\ValidateDocumentUy;

ValidateDocumentUy::isValid('12345672'); // true
ValidateDocumentUy::controlDigit('1234567'); // returns 2
ValidateDocumentUy::generateRandomDocument(); // returns a valid CI string
```

---

Translations
------------

[](#translations)

Validation messages are available in English and Spanish.

To publish the translation files:

```
php artisan vendor:publish --tag=validate-document-uy
```

The files will be located in:

```
resources/lang/vendor/validate-document-uy/en/validation.php
resources/lang/vendor/validate-document-uy/es/validation.php

```

---

Tests
-----

[](#tests)

```
vendor/bin/phpunit
```

Includes unit and feature tests for all validation cases.

---

Directory structure
-------------------

[](#directory-structure)

```
src/
├── Facades/
│   └── ValidateDocumentUy.php
├── Providers/
│   └── ValidateDocumentUyServiceProvider.php
├── Rules/
│   └── ValidUruguayanCiRule.php
├── Services/
│   └── UruguayanCiValidator.php
├── Support/
│   └── ValidatesUruguayanCi.php

```

---

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance45

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

423d ago

Major Versions

v1.0 → V2.02025-04-22

V2.0 → v3.02025-05-06

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

composerlaravelphpvalidator

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pfrug-validate-document-uy/health.svg)

```
[![Health](https://phpackages.com/badges/pfrug-validate-document-uy/health.svg)](https://phpackages.com/packages/pfrug-validate-document-uy)
```

###  Alternatives

[illuminate/validation

The Illuminate Validation package.

18838.2M1.7k](/packages/illuminate-validation)

PHPackages © 2026

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