Analysis updated 2026-05-18
Reject malformed Indonesian NIK numbers on a registration or government service form.
Verify that a NIK's birth date, gender, and province match expected values using a fluent API.
Add NIK-aware validation directly to a Laravel Eloquent model.
Cross-check a NIK's embedded district code against a bundled dataset without a database call.
| bensondevs/indonesian-ktp | fzw005421/wanfeng-video | iamjohnwhite/bricks-floating-panels | |
|---|---|---|---|
| Stars | 21 | 21 | 21 |
| Language | PHP | PHP | PHP |
| Setup difficulty | easy | hard | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | designer |
Figures from each repo's GitHub metadata at analysis time.
Requires PHP 8.3 or higher, Laravel integration needs Laravel 10 through 13.
Indonesian KTP (NIK) Validation is a PHP library that checks whether an Indonesian national identity number, called a NIK (Nomor Induk Kependudukan), is structurally valid and refers to a real administrative region. Every Indonesian citizen has a 16-digit NIK on their KTP (identity card) that encodes their province, regency, subdistrict, birth date, gender, and a serial number. This library validates that structure and cross-references the embedded district code against a bundled dataset of Indonesian administrative regions (called wilayah), so no database query is needed at runtime. You can use it as a standalone PHP class by calling a fluent API, for example, checking that a NIK belongs to a male person born on a specific date in Central Java, or you can plug it directly into Laravel's validation system as a custom rule. The library supports chaining optional expectations for birth date, age, gender, province, regency, and subdistrict, and returns either a simple true/false or a detailed result object that tells you exactly which checks passed or failed. It also includes a trait for Laravel's Eloquent ORM that adds NIK-aware methods to a database model. You would use this when building a PHP or Laravel application that collects Indonesian identity numbers, for instance, a government service, a fintech registration form, or an HR system, and needs to reject malformed or nonsensical NIK values before saving them. The library requires PHP 8.3 or higher and Laravel 10 through 13. The full README is longer than what was provided.
A PHP library that validates Indonesian national identity numbers (NIK) and checks them against real administrative regions.
Mainly PHP. The stack also includes PHP, Laravel, Eloquent.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.