hakhant / convert-mm
Myanmar date and NRC number converter
v1.0.1
2024-05-20 20:31 UTC
Requires
- illuminate/support: ^7.0 || ^8.0 || ^9.0 || ^10.0
Requires (Dev)
- orchestra/testbench: ^6.0
- pestphp/pest: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Installation
Install the package via Composer:
composer require hakhant/convert-mm
Publish the configuration
php artisan vendor:publish --tag=convert
Usage
Convert a number to Myanmar format
$number = '1234567'; $convert = Convert::mm($number); return $convert; // Output: '၁၂၃၄၅၆၇'
Convert a date to Myanmar format
$today = '2023-08-07'; $convert = Convert::mmDate($today); return $convert; // Output: '၂၀၂၃ ခုနှစ်၊သြဂုတ်လ၊ ၀၇ ရက်'
Date available lists
$mmDateNumber = Convert::mmDateNumber('2023-08-07'); // Output: '၂၀၂၃-၀၈-၀၇' $year = Convert::year('2023'); // Output: '၂၀၂၃' $month = Convert::month('08'); // Output: 'သြဂုတ်' $day = Convert::day('8'); // Output: '၈'
NRC available lists
$regions = Convert::regions(); // Returns an array of regions in English. $mmRegions = Convert::mmRegions(); // Returns an array of regions in Myanmar. $citizens = Convert::citizens(); // Returns an array of citizens. $mmCitizens = Convert::mmCitizens(); // Returns an array of citizens in Myanmar. $townships = Convert::townships(); // Returns an array of townships. $mmTownships = Convert::mmTownships(); // Returns an array of townships in Myanmar. $number = Convert::nrcNumber('215556'); // Returns '215556'. $mmNumber = Convert::mmNrcNumber('215556'); // Returns '၂၁၅၅၅၆'. $fullNrc = Convert::fullNrc('12/', 'YaKaNa', '(N)', 215556); // Or: Convert::fullNrc('12', 'YaKaNa', 'N', 215556); // Example output: '12/YaKaNa(N)215556' $mmFullNrc = Convert::mmFullNrc('၁၂/', 'ရကန', '(နိုင်)', 215556); // Or: Convert::mmFullNrc('၁၂', 'ရကန', 'နိုင်', 215556); // Example output: '၁၂/ရကန(နိုင်)၂၁၅၅၅၆'
Test Suite Status
The badge at the top reports the status of the GitHub Actions test workflow on pushes to main.
Run the test suite locally with:
composer test
Changelog
See CHANGELOG for details about recent changes.
Contributing
See CONTRIBUTING for contribution details.
Security
For security issues, email info@hakhant.tech instead of using the issue tracker.
Credits
License
The MIT License (MIT). See LICENSE for details.