avto-dev/identity-laravel

IDEntity for Laravel
31,310 3
Install
composer require avto-dev/identity-laravel
Latest Version:v6.0.1
PHP:^8.2
License:MIT
Last Updated:Aug 21, 2026
Links: GitHub  ·  Packagist
Maintainer: eldario

IDEntity

Version PHP Version Build Status Coverage Downloads count License

IDEntity (identification entities) is objects with implemented methods of validation, normalization, and optional automatic type determination.

Installation

Require this package with composer using the next command:

$ composer require avto-dev/identity-laravel "^6.0"

Installed composer is required. To install composer, please click here.

Please note that you need to fix the major version of the package.

After that you can "publish" configuration file (./config/identity.php) using next command:

$ ./artisan vendor:publish --provider="AvtoDev\IDEntity\ServiceProvider"

Usage

Below you can find some usage examples.

Type detection:

use AvtoDev\IDEntity\IDEntity;

IDEntity::is('JF1SJ5LC5DG048667', IDEntity::ID_TYPE_VIN); // true
IDEntity::is('A123AA177', IDEntity::ID_TYPE_VIN); // false

IDEntity::is('JF1SJ5LC5DG048667', IDEntity::ID_TYPE_GRZ); // false
IDEntity::is('A123AA177', IDEntity::ID_TYPE_GRZ); // true

IDEntity::is('14:36:102034:2256', IDEntity::ID_TYPE_CADASTRAL_NUMBER); // true
IDEntity::is('JF1SJ5LC5DG048667', IDEntity::ID_TYPE_CADASTRAL_NUMBER); // false

$valid_vin = IDEntity::make('JF1SJ5LC5DG048667', IDEntity::ID_TYPE_VIN);
$valid_vin->isValid(); // true

$invalid_vin = IDEntity::make('SOME INVALID', IDEntity::ID_TYPE_VIN);
$invalid_vin->isValid(); // false

Entities creation:

use AvtoDev\IDEntity\IDEntity;
use AvtoDev\IDEntity\Types\IDEntityCadastralNumber;

$vin = IDEntity::make('JF1SJ5LC5DG048667');
$vin->getType();  // 'VIN'
$vin->getValue(); // 'JF1SJ5LC5DG048667'
$vin->isValid();  // true
\get_class($vin); // 'AvtoDev\IDEntity\Types\IDEntityVin'

$cadastral_number = new IDEntityCadastralNumber('10:01:0030104:691');
$cadastral_number->getType(); // 'CADNUM'
$cadastral_number->isValid(); // true

Some typed entity classes contains a lot of additional methods for a working with passed value.

Value normalization:

use AvtoDev\IDEntity\IDEntity;
use AvtoDev\IDEntity\Types\IDEntityVin;

$vin = new IDEntityVin(' jf1SJ5LC5DG048 667');
$vin->getValue(); // 'JF1SJ5LC5DG048667'

IDEntity::make('  a123аY777', IDEntity::ID_TYPE_GRZ)->getValue(); // 'А123АУ777'

Value masking:

<?php

use AvtoDev\IDEntity\Types\IDEntityVin;

$vin = IDEntityVin::make('JF1SJ5LC5DG048667');
$vin->getMaskedValue(2, 4);      // JF***********8667
$vin->getMaskedValue(4, 2, '_'); // JF1S___________67

Testing

For package testing we use phpunit framework and docker-ce + docker-compose as develop environment. So, just write into your terminal after repository cloning:

$ make build
$ make latest # or 'make lowest'
$ make test

Changes log

Release date Commits since latest release

Changes log can be found here.

Support

Issues Issues

If you will find any package errors, please, make an issue in current repository.

License

This is open-sourced software licensed under the MIT License.

Related Packages

filafly/filament-identity-column

A column for Filament Tables to which combines an avatar, name and description.

11,537 7
worksome/laravel-onfido

A Laravel wrapper for the Onfido PHP client

444,794 1
andrevalentin/laravel-onfido

A Laravel wrapper for the Onfido PHP client

170,030 4
jlorente/laravel-identitystamps

A Laravel plugin to register and keep control of the users who make creations, u...

6,214 1
archerzdip/laravel-identity

Chinese ID number generate and verity.

3,429 7

Version History

Version Released PHP Laravel License
v6.0.1 ^8.2 ~11.0 || ~12.0 || ~13.0 MIT
v6.0.0 ^8.1 ~10.0 || ~11.0 || ~12.0 MIT
v5.11.0 ^8.2 ~11.0 || ~12.0 || ~13.0 MIT
v5.10.0 ^8.1 ~10.0 || ~11.0 || ~12.0 MIT
v5.9.0 ^8.1 ~10.0 || ~11.0 MIT