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 today

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 41% 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

1201d 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

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.6k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k39](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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