PHPackages                             zerosdev/nik-reader - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zerosdev/nik-reader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zerosdev/nik-reader
===================

Identity data reader based on NIK (Nomor Induk Kependudukan)

v1.0.0(1w ago)257694MITPHPPHP ^7.2|^8.0

Since Oct 4Pushed 4y ago1 watchersCompare

[ Source](https://github.com/zerosdev/nik-reader)[ Packagist](https://packagist.org/packages/zerosdev/nik-reader)[ Docs](https://github.com/zerosdev/nik-reader)[ RSS](/packages/zerosdev-nik-reader/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (4)Versions (5)Used By (0)

NIK Reader
==========

[](#nik-reader)

###### Identity data reader based on NIK (Nomor Induk Kependudukan)

[](#identity-data-reader-based-on-nik-nomor-induk-kependudukan)

 [![build](https://github.com/ZerosDev/nik-reader/workflows/build/badge.svg)](https://github.com/ZerosDev/nik-reader/workflows/build/badge.svg) [![release](https://camo.githubusercontent.com/6559eae66c2183dd482e1e55f4ec0bd83ee70a668a4569bb5f3785587713ca40/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f5a65726f734465762f6e696b2d7265616465723f696e636c7564655f70726572656c6561736573)](https://camo.githubusercontent.com/6559eae66c2183dd482e1e55f4ec0bd83ee70a668a4569bb5f3785587713ca40/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f5a65726f734465762f6e696b2d7265616465723f696e636c7564655f70726572656c6561736573) [![language](https://camo.githubusercontent.com/f55a7041e746fb62b2f1a129b3768ddc781bf88681edf4f9015c8b14df8ba6d1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f5a65726f734465762f6e696b2d726561646572)](https://camo.githubusercontent.com/f55a7041e746fb62b2f1a129b3768ddc781bf88681edf4f9015c8b14df8ba6d1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f5a65726f734465762f6e696b2d726561646572) [![license](https://camo.githubusercontent.com/115b75a52b0c06bd4b811d8ed9ea7085068f3730d0f230cde9ffa06c91198227/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5a65726f734465762f6e696b2d726561646572)](https://camo.githubusercontent.com/115b75a52b0c06bd4b811d8ed9ea7085068f3730d0f230cde9ffa06c91198227/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5a65726f734465762f6e696b2d726561646572) [![size](https://camo.githubusercontent.com/415acd0526a9df678864613a597abbebc3a3ec5242bf471387d01f43f8681d00/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f5a65726f734465762f6e696b2d726561646572)](https://camo.githubusercontent.com/415acd0526a9df678864613a597abbebc3a3ec5242bf471387d01f43f8681d00/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f5a65726f734465762f6e696b2d726561646572) [![downloads](https://camo.githubusercontent.com/2438bbdf04b1e3a0cc1965430b4b59d52f00e5466045d097fe451650201ae53b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f5a65726f734465762f6e696b2d7265616465722f746f74616c)](https://camo.githubusercontent.com/2438bbdf04b1e3a0cc1965430b4b59d52f00e5466045d097fe451650201ae53b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f5a65726f734465762f6e696b2d7265616465722f746f74616c) [![pulls](https://camo.githubusercontent.com/dd0b24c1e6776719edb2c273548a510d6490d8d25269a043dfabbd38419905da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)](https://camo.githubusercontent.com/dd0b24c1e6776719edb2c273548a510d6490d8d25269a043dfabbd38419905da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5052732d77656c636f6d652d627269676874677265656e2e737667)

About
-----

[](#about)

This library gives you a way to convert the NIK number into useful information such as: Region name (province, city, sub-district), date of birth, gender, zodiac, age, and more. This can also be used to validate whether the NIK number is valid or not. Here is the example result :

```
{
    "valid": true,
    "nik": "3502200101000001",
    "province_id": "35",
    "province": "JAWA TIMUR",
    "city_id": "3502",
    "city": "KAB. PONOROGO",
    "subdistrict_id": "350220",
    "subdistrict": "JAMBON",
    "postal_code": "63456",
    "birthday": "01-01-2000",
    "age":
    {
        "year": 21,
        "month": 9,
        "day": 25
    },
    "zodiac": "Capricorn",
    "gender": "male",
    "unique_code": "0001"
}
```

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

[](#installation)

1. Run command

```
composer require zerosdev/nik-reader
```

Usage
-----

[](#usage)

### Laravel

[](#laravel)

```
// .........
public function method()
{
    $nik = '3502200101910001';
    $result = \NikReader::read($nik);

    if (true === $result->valid) {
        // code
    }
}
```

### Non-Laravel

[](#non-laravel)

```
