PHPackages                             k2oumais/lei - 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. k2oumais/lei

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

k2oumais/lei
============

LEI generator and validator

1.0.2(3y ago)115MITPHPPHP ^7.4|^8.0|^8.1|^8.2

Since Mar 12Pushed 3y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

LEI generator and validator
===========================

[](#lei-generator-and-validator)

A package to generate and validate a LEI (Legal Entity Identifier).

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

[](#installation)

You can install the package via composer:

```
composer require k2oumais/lei
```

You can publish the config file with:

```
php artisan vendor:publish --tag="lei-config"
```

This is the contents of the published config file:

```
return [

    /*
    |--------------------------------------------------------------------------
    | LEI Prefix
    |--------------------------------------------------------------------------
    |
    | This is the Local Operating Unit (LOU) code.
    |
    */

    'lou_code' => env('LEI_LOU_CODE', '1234'),

    /*
    |--------------------------------------------------------------------------
    | LEI Reserved
    |--------------------------------------------------------------------------
    |
    | This is the reserved value of an LEI.
    |
    */

    'reserved' => env('LEI_RESERVED_VALUE', '00'),
];
```

Usage
-----

[](#usage)

```
$lei = new K2ouMais\Lei\Lei();

// Generate a LEI
$generatedLei = $lei->generate();   // 123400V9I8UWAKBIWH79

// Validate a LEI
$validateLei = $lei->validate('123400V9I8UWAKBIWH79');  // true
$validateLei = $lei->validate('12340013KCVCMU58YY44');  // false
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [João Alves](https://github.com/K2ouMais)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

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

Total

3

Last Release

1147d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72579753447496daebf0135fe32cc43e44e0e1003a6349c6fbb051a018a6baa8?d=identicon)[K2ouMais](/maintainers/K2ouMais)

---

Top Contributors

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

---

Tags

financial-datagenerategeneratorlegal-entity-identifierleivalidatevalidatorlaravelleiK2ouMais

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/k2oumais-lei/health.svg)

```
[![Health](https://phpackages.com/badges/k2oumais-lei/health.svg)](https://phpackages.com/packages/k2oumais-lei)
```

###  Alternatives

[proengsoft/laravel-jsvalidation

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

1.1k2.3M49](/packages/proengsoft-laravel-jsvalidation)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[ziming/laravel-zxcvbn

Zxcvbn Password validation rule for Laravel

3056.7k](/packages/ziming-laravel-zxcvbn)[laravel-validation-rules/phone

Validate that a phone number is in the correct format

69355.5k](/packages/laravel-validation-rules-phone)

PHPackages © 2026

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