PHPackages                             moetain/myanmar-phone-checker - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. moetain/myanmar-phone-checker

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

moetain/myanmar-phone-checker
=============================

A reusable phone number validation package for Laravel.

00PHP

Since Feb 5Pushed 3mo agoCompare

[ Source](https://github.com/tinmaunglynnwebdev-sudo/myanmar-phone-checker)[ Packagist](https://packagist.org/packages/moetain/myanmar-phone-checker)[ RSS](/packages/moetain-myanmar-phone-checker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Phone Checker for Laravel
=========================

[](#phone-checker-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e2600e12b3a95d96d9ec28d8e26aace38470834622f95b2fb13b4bd3f3ee994c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f657461696e2f6d79616e6d61722d70686f6e652d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/moetain/myanmar-phone-checker)[![Total Downloads](https://camo.githubusercontent.com/6fb66e047831120ae2f365599cc6cb9162b32f504cef55c0a2ca8fd3f605f254/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6f657461696e2f6d79616e6d61722d70686f6e652d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/moetain/myanmar-phone-checker)[![License](https://camo.githubusercontent.com/3590ee2ad4a698ee7ba55bc8259728b81ca0050afde1b49b99da08656a4ca478/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f657461696e2f6d79616e6d61722d70686f6e652d636865636b65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/moetain/myanmar-phone-checker)[![Tests](https://camo.githubusercontent.com/c3f9fe123ba87ccdc60e32034b622db1bb189675eec10610d90b74de59e77c6a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f74696e6d61756e676c796e6e7765626465762d7375646f2f70686f6e652d636865636b65722d6c61726176656c2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/tinmaunglynnwebdev-sudo/phone-checker-laravel/actions)

A sophisticated, highly configurable phone number validation and identification package for Laravel. Designed for precision, it handles sanitization, validation, and advanced metadata extraction like operator and country detection.

🚀 Features
----------

[](#-features)

- **Global Validation**: Precision rules for Myanmar (MM), Thailand (TH), Japan (JP), United States (US), China (CN), Vietnam (VN), and United Kingdom (GB).
- **Operator Detection**: Specialized detection for Myanmar carriers (MPT, ATOM, U9/Ooredoo, Mytel).
- **Country Identification**: Automatically resolve the country from any given phone number.
- **Smart Sanitization**: Robustly handles common formatting characters (`-`, ` ` , `( )`) before processing.
- **E.164 &amp; Local Formats**: Supports both international and national dialing formats.
- **Pest Powered**: Ships with a comprehensive Pest test suite.

📦 Installation
--------------

[](#-installation)

Install the package via composer:

```
composer require moetain/myanmar-phone-checker
```

The service provider will automatically register itself.

⚙️ Configuration
----------------

[](#️-configuration)

Publish the config file to customize default behavior and add new country rules:

```
php artisan vendor:publish --tag="phone-checker-config"
```

The configuration file allows you to:

- Change the **default country**.
- Add or modify **country rules** (regex, prefixes, lengths).
- Define **operators** with names and logos for any country.

🛠 Usage
-------

[](#-usage)

### Basic Validation

[](#basic-validation)

The package provides a convenient `PhoneChecker` facade and is also available via dependency injection.

#### Via Facade

[](#via-facade)

```
use Moetain\PhoneChecker\Facades\PhoneChecker;

// Check if a number is valid for Myanmar
PhoneChecker::check('09421234567', 'MM'); // true
```

#### Via Dependency Injection

[](#via-dependency-injection)

```
use Moetain\PhoneChecker\PhoneChecker;

public function store(Request $request, PhoneChecker $checker)
{
    if ($checker->check($request->phone, 'MM')) {
        // ...
    }
}
```

### Laravel Validation Rule

[](#laravel-validation-rule)

The package includes a custom validation rule for seamless integration with Laravel's validation system.

```
use Moetain\PhoneChecker\Rules\Phone;

$request->validate([
    'phone' => ['required', new Phone('MM')],
]);
```

### Country Detection

[](#country-detection)

Resolve the country of origin from a raw phone string.

```
// Detects country automatically
$country = PhoneChecker::getCountry('+66 912 345 678'); // 'TH'
$country = PhoneChecker::getCountry('+1-123-456-7890'); // 'US'
```

### Operator Information (Myanmar Specialized)

[](#operator-information-myanmar-specialized)

Identify the carrier and retrieve operator metadata.

```
// Get operator key (e.g., 'MPT', 'ATOM', 'U9', 'Mytel')
$operator = PhoneChecker::getOperator('09951234567'); // 'U9'

// Get display-friendly operator name
$operatorName = PhoneChecker::getOperatorName('09951234567'); // 'Ooredoo / U9'

// Get operator logo URL
$logo = PhoneChecker::getOperatorLogo('09951234567'); // 'https://.../u9-logo.png'
```

### Country Metadata

[](#country-metadata)

Retrieve details about the detected or specified country.

```
// Get country flag (emoji)
$flag = PhoneChecker::getFlag('MM'); // '🇲🇲'

// Get full country name
$name = PhoneChecker::getName('MM'); // 'Myanmar'

// Get international dialing code
$code = PhoneChecker::getCountryCode('MM'); // '+95'
```

### Comprehensive Information

[](#comprehensive-information)

Get all available information about a phone number in a single call.

```
$info = PhoneChecker::getInfo('09421234567');

/*
Returns:
[
    'phone'    => '09421234567',
    'country'  => 'Myanmar',
    'iso'      => 'MM',
    'flag'     => '🇲🇲',
    'code'     => '+95',
    'operator' => 'MPT',
    'logo'     => 'https://...',
    'is_valid' => true,
]
*/
```

🧪 Testing
---------

[](#-testing)

The package is tested heavily using Pest. To run the tests, execute:

```
composer test
```

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

myanmar-phone-checker
=====================

[](#myanmar-phone-checker)

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance55

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/96883b79362c65433d9dd9c100ac166e299821fe7e6bc24125864d6742d83779?d=identicon)[tinmaunglynnwebdev-sudo](/maintainers/tinmaunglynnwebdev-sudo)

### Embed Badge

![Health badge](/badges/moetain-myanmar-phone-checker/health.svg)

```
[![Health](https://phpackages.com/badges/moetain-myanmar-phone-checker/health.svg)](https://phpackages.com/packages/moetain-myanmar-phone-checker)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
