Myanmar phone number များနှင့်ပတ်သက်ပြီး format လုပ်ခြင်းနှင့် check လုပ်နိုင်ရန်ရည်ရွယ်ပြီးတည်ဆောက်သည်။
Composer ကိုသုံးပြီး Install လုပ်ပါ။
composer require fawkescreatives/myanmar-phone
Laravel Package Auto-Discovery မလုပ်လျှင် config/app.php
file ထဲမှ providers
ထဲမှာ ဒီလိုသွားထည့်ပါ။
/*
* Package Service Providers...
*/
MyanmarPhone\MyanmarPhoneServiceProvider::class,
php artisan vendor:publish --provider="MyanmarPhone\MyanmarPhoneServiceProvider"
config/myanmar_phone.php
တွင် default format standard ကိုသတ်မှတ်နိုင်သည်။
- Option 1: Use Injection
use MyanmarPhone\MyanmarPhone;
public function index(MyanmarPhone $service)
{
$phone = '09251234567';
return $service->make($phone)->getPhoneNumber();
}
- Option 2: Use Facade
use MyanmarPhone\Facades\MyanPhone;
public function index()
{
$phone = '09251234567';
return MyanPhone::make($phone)->getPhoneNumber();
}
eg..,
Validator::make($data, [
'phone_number' => [
'myanmar_phone'
],
]);
eg..,
MyanPhone::make($phone)->format(2); // look format number in config
- format($format)
- formatE164()
- formatInternational()
- formatRFC3966(string $separator = null)
- formatNational(string $separator = null)
- operator($number = null)
- telecom($number = null)
- isTelenor($number = null)
- isOoredoo($number = null)
- isMpt($number = null)
- isMyTel($number = null)
- isMec($number = null)
- getCountryCode()
- getStrPhoneNumber()
- getPhoneNumber($leadingZero = true)
You can run the tests with:
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.