PHPackages                             wapacro/identity-validator - 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. wapacro/identity-validator

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

wapacro/identity-validator
==========================

Allows you to check identity cards and passports all over the world!

1.1(9y ago)219BSD-2-ClausePHPPHP &gt;=7.0

Since Jun 12Pushed 9y ago1 watchersCompare

[ Source](https://github.com/wapacro/IdentityValidator)[ Packagist](https://packagist.org/packages/wapacro/identity-validator)[ RSS](/packages/wapacro-identity-validator/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

Identity Validator
==================

[](#identity-validator)

Identity Validator is a package that allows you to verify a user by his identity card or passport. The package supports XML templates to easily handle the local differences between the format of the machine readable lines of different identity cards or passports. I've planned some cool stuff other than just verifying, so stay tuned!

Install
=======

[](#install)

Since this is a Composer package, simply run the following command to install it:

```
composer require wapacro/identity-validator

```

Use
===

[](#use)

Let your user enter the machine readable line on his identity document and let this package do the magic! First, initialize the package;

```
$id = new \wapacro\IdentityValidator\IdentityValidator();

```

You can get a list of supported identity documents (and what country they belong to) by executing:

```
(array) $id->getSupportedTypes();

```

Then select the template you want to use. Select it by using the dot notation, which is shown as *notation* in the supported documents list. You can also pass the desired template in the constructor.

```
$id->setTemplate('CH.id');

```

So let's get to it; Add the machine readable lines, which your user entered:

```
$id->addMachineReadableLines('IDCHEE2556414
