Skip to content

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

License

Notifications You must be signed in to change notification settings

K2ouMais/lei

Repository files navigation

LEI generator and validator

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

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

$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

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.