Skip to content

Latest commit

 

History

History
121 lines (84 loc) · 2.74 KB

README-en.md

File metadata and controls

121 lines (84 loc) · 2.74 KB

Laravel Myanmar Phone

Latest Version on Packagist Laravel 10.x Laravel 11.x Total Downloads License

It is designed to format and check Myanmar phone numbers.

Table of Contents

Installation

You can install this package via composer using this command:

composer require fawkescreatives/myanmar-phone

The package will automatically register itself.

/*
 * Package Service Providers...
 */

MyanmarPhone\MyanmarPhoneServiceProvider::class,

Configuration

You can publish the config-file with:

php artisan vendor:publish --provider="MyanmarPhone\MyanmarPhoneServiceProvider"

You can define default format standard at config/myanmar_phone.php

Usage

  • 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();
}

Functions

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)

Testing

You can run the tests with:

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

License

The MIT License (MIT). Please see License File for more information.