PHPackages                             vicent/laque-identity - 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. vicent/laque-identity

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

vicent/laque-identity
=====================

Laque Identity — Tanzania-focused KYC utilities: MRZ parsing (TD1/TD3), NIDA client, TIN &amp; phone validation, and scoring. Framework-agnostic, SOLID, PSR-compliant.

v1.0.1(8mo ago)01MITPHPPHP ^8.1CI passing

Since Aug 22Pushed 8mo agoCompare

[ Source](https://github.com/xaverymsomi/Laque-Identity-Package)[ Packagist](https://packagist.org/packages/vicent/laque-identity)[ RSS](/packages/vicent-laque-identity/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Laque Identity
==============

[](#laque-identity)

[![Logo](branding/laque-identity.svg)](branding/laque-identity.svg)

[![Latest Stable Version](https://camo.githubusercontent.com/ec8b14bd3fb491b0279f8976576d722a285a88ea81e2e354a07f2d132354686d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766963656e742f6c617175652d6964656e746974792e737667)](https://packagist.org/packages/vicent/laque-identity)[![Release Drafter](https://camo.githubusercontent.com/81d2fa7e012b2567d53f5466ae71b110efbf4b1bde63632f5d16516ee6bca600/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f52656c656173652d447261667465722d364135414344)](#)[![codecov](https://camo.githubusercontent.com/833ba762d51b642818ef8a335d2e1f5bc85853a8ca0a59faeb860ea241642fe0/68747470733a2f2f636f6465636f762e696f2f67682f766963656e742d6465762f6c617175652d6964656e746974792f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/vicent-dev/laque-identity)

[![PHP](https://camo.githubusercontent.com/83dd395020c37276225039739320f6c8e7e99963ab21ee3d09282cb48dad2a60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c7565)](#)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![CI](https://camo.githubusercontent.com/accefd1579648bf27233fd1eddb3990129fc1ef34eba68f3a4d017c7c1ef4425/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963656e742d6465762f6c617175652d6964656e746974792f74657374732e796d6c3f6272616e63683d6d61696e)](#)

**Laque Identity** is a Tanzania‑focused PHP library for **KYC**:

- **MRZ parsing &amp; validation** (TD1 for ID cards, TD3 for passports)
- **NIDA client** (pluggable; replace base URL with your production endpoint)
- **TIN &amp; Phone validation** for Tanzania (with **operator detection**)
- **KYC scoring** (names, DoB, phone, document #)

Framework‑agnostic, SOLID, PSR‑compliant.

---

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

[](#installation)

```
composer require vicent/laque-identity
```

---

Quick Start
-----------

[](#quick-start)

```
use Laque\Identity\Core\IdentityService;
use Laque\Identity\Providers\MockProvider;
use Laque\Identity\Dto\IdentityQuery;

// Build a service with a provider (Mock here; swap with NidaProvider)
$service = new IdentityService(new MockProvider());

// Query using MRZ (passport TD3) or NIDA number/DoB
$q = new IdentityQuery(
    nidaNumber: '19876543210987654321',
    dateOfBirth: '1990-01-01',
    firstName: 'FROLIAN',
    lastName: 'ERNEZ',
    phone: '0712 345 678',
    tin: '123-456-789',
    mrz: null // or provide two-line MRZ string
);

$result = $service->verify($q);

// $result->matched(): bool
// $result->score(): float  // 0..1
// $result->reasons(): array
```

---

MRZ Parsing
-----------

[](#mrz-parsing)

```
use Laque\Identity\Core\MrzParser;

$td3 = "P
