tesla-software / jmbg
Validate, generate and extract data from JMBG (Unique Master Citizen Number)
Installs: 1 824
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: ^8.0|^8.1|^8.2
Requires (Dev)
- phpstan/phpstan: ^1.10
- phpunit/phpunit: >=9.0
- squizlabs/php_codesniffer: ^3.4
README
Validate, generate and extract data from JMBG (Unique Master Citizen Number).
Install
Via Composer
composer require tesla-software/jmbg
Usage
Validation
use Tesla\JMBG\JMBG; // Check if JMBG is valid JMBG::for('2509992391801')->isValid(); // Returns: true // Extract birthday JMBG::for('2509992391801')->getBirthday(); // Returns: DateTime (1992-09-25) // Extract gedner (m for males, f for females) JMBG::for('2509992391801')->getGender(); // Returns: m
Generation
use Tesla\JMBG\Generator; $gen = new Generator; // Returns valid random JMBG $gen->fake(); // Override params [day, month, year, region, gender] $gen->fake(25, 9, 992, '57', '321');
Testing
$ composer test