Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexeevdv/indonesia-personal-id
https://github.com/alexeevdv/indonesia-personal-id
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/alexeevdv/indonesia-personal-id
- Owner: alexeevdv
- License: mit
- Created: 2018-05-03T05:17:56.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-05-06T13:53:54.000Z (over 6 years ago)
- Last Synced: 2024-11-22T16:30:00.887Z (about 2 months ago)
- Language: PHP
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
indonesia-personal-id
================[![Build Status](https://travis-ci.org/alexeevdv/indonesia-personal-id.svg?branch=master)](https://travis-ci.org/alexeevdv/indonesia-personal-id)
[![codecov](https://codecov.io/gh/alexeevdv/indonesia-personal-id/branch/master/graph/badge.svg)](https://codecov.io/gh/alexeevdv/indonesia-personal-id)
![PHP 5.6](https://img.shields.io/badge/PHP-5.6-green.svg)
![PHP 7.0](https://img.shields.io/badge/PHP-7.0-green.svg)
![PHP 7.1](https://img.shields.io/badge/PHP-7.1-green.svg)
![PHP 7.2](https://img.shields.io/badge/PHP-7.2-green.svg)## Installation
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
$ php composer.phar require alexeevdv/indonesia-personal-id "~1.0.0"
```or add
```
"alexeevdv/indonesia-personal-id": "~1.0.0"
```to the ```require``` section of your `composer.json` file.
## Usage
### Validator
```php
use alexeevdv\personalid\indonesia\Validator;$validator = new Validator;
$isValid = $validator->validate('NIK_TO_BE_VALIDATED');```
### Parser
```php
use alexeevdv\personalid\indonesia\Parser;$parser = new Parser;
// Returns identity instance
$identity = $parser->parse('NIK_TO_BE_PARSED');
echo $identity->birthDate()->format('Y-m-d');
```### Builder
```php
use alexeevdv\personalid\indonesia\Builder;$builder = new Builder;
$randomNik = $builder->random();
// Generates NIK from identity instance
$nikFromIdentity = $builder->fromIdentity($identity);```
### Identity
You can find full methods list in `\alexeevdv\personalid\indonesia\Identity`