PHP Myanmar Nrc for Laravel Myanmar Tools
composer require laravel-myanmar-tools/nrc
use LaravelMyanmarTools\Nrc\Nrc;
$nrc = new Nrc;
$nrc->isNrc('12/OUKAMA(N)123456'); // return true
$nrc->isNrc('12/OuKaMa(Naing)123456'); // return true
$nrc->isNrc('၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆'); // return true
use LaravelMyanmarTools\Nrc\Nrc;
$nrc = new Nrc;
$nrc->normalizeNrc('12/OUKAMA(N)123456'); // return "12/OUKAMA(N)123456"
$nrc->normalizeNrc('12/OUKAMA(N)123456', 'mm'); // return "၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆"
$nrc->normalizeNrc('12/OuKaMa(Naing)123456'); // return "12/OUKAMA(N)123456"
$nrc->normalizeNrc('12/OuKaMa(Naing)123456', 'mm'); // return "၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆"
$nrc->normalizeNrc('၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆'); // return "12/OUKAMA(N)123456"
$nrc->normalizeNrc('၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆', 'mm'); // return "၁၂/ဥကမ(နိုင်)၁၂၃၄၅၆"
use LaravelMyanmarTools\Nrc\Nrc;
use Illuminate\Support\Str;
$nrc = new Nrc;
$nrc::macro('isYangon', function(string $nrc) {
return Str::before($nrc, '/') == '12';
});
$nrc->isYangon('12/OuKaMa(Naing)123456'); // return true
composer test