A package for Myanmar Font, Phone and other Myanmar tools using Laravel Macro

Overview

Laravel Myanmar Tools

A package for Myanmar Font, Phone and other Myanmar tools using Laravel Macro.

Installation

composer require pyaesoneaung/laravel-myanmar-tools

Str

Check Unicode Font

use Illuminate\Support\Str;
Str::isUnicodeFont('မြန်မာပြည်'); // return true

Check Zawgyi Font

use Illuminate\Support\Str;
Str::isZawgyiFont('ျမန္မာျပည္'); // return true

Detect Myanmar Font

use Illuminate\Support\Str;
Str::detectMyanmarFont('မြန်မာပြည်'); // return 'unicode'
Str::detectMyanmarFont('ျမန္မာျပည္'); // return 'zawgyi'

Convert Zawgyi to Unicode

use Illuminate\Support\Str;
Str::zgToUni('ျမန္မာျပည္'); // return 'မြန်မာပြည်'

Convert Unicode to Zawgyi

use Illuminate\Support\Str;
Str::uniToZg('မြန်မာပြည်'); // return 'ျမန္မာျပည္'

Check Myanmar Phone Number

use Illuminate\Support\Str;
Str::isMyanmarPhoneNumber('09250000000'); // return true

Check MPT

use Illuminate\Support\Str;
Str::isMpt('09250000000'); // return true

Check Ooredoo

use Illuminate\Support\Str;
Str::isOoredoo('09970000000'); // return true

Check Telenor

use Illuminate\Support\Str;
Str::isTelenor('09790000000'); // return true

Check MEC

use Illuminate\Support\Str;
Str::isMec('0930000000'); // return true

Check Mytel

use Illuminate\Support\Str;
Str::isMytel('09690000000') // return true

Get Telecom Name

use Illuminate\Support\Str;
Str::telecomName('09251234567'); // return 'mpt'
Str::telecomName('09970000000'); // return 'ooredoo'
Str::telecomName('09790000000'); // return 'telenor'
Str::telecomName('0930000000');  // return 'mec'
Str::telecomName('09690000000'); // return 'mytel'

Collection

whereMyanmarPhoneNumber()

$data = ['09250000000', 'abc'];
collect($data)->whereMyanmarPhoneNumber()->toArray(); 
// ['09250000000']

$data = [
    ['phone' => '09250000000'],
    ['phone' => 'abc']
];
collect($data)->whereMyanmarPhoneNumber('phone')->toArray();
/*
    [
        ['phone' => '09250000000']
    ]
*/

whereMpt()

$data = ['09250000000', '09970000000'];
collect($data)->whereMpt()->toArray(); 
// ['09250000000']

$data = [
    ['phone' => '09250000000'],
    ['phone' => '09970000000']
];
collect($data)->whereMpt('phone')->toArray();
/*
    [
        ['phone' => '09250000000']
    ]
*/

whereOoredoo()

$data = ['09250000000', '09970000000'];
collect($data)->whereOoredoo()->toArray(); 
// ['09970000000']

$data = [
    ['phone' => '09250000000'],
    ['phone' => '09970000000']
];
collect($data)->whereOoredoo('phone')->toArray();
/*
    [
        ['phone' => '09970000000']
    ]
*/

whereTelenor()

$data = ['09250000000', '09790000000'];
collect($data)->whereTelenor()->toArray(); 
// ['09790000000']

$data = [
    ['phone' => '09250000000'],
    ['phone' => '09790000000']
];
collect($data)->whereTelenor('phone')->toArray();
/*
    [
        ['phone' => '09790000000']
    ]
*/

whereMec()

$data = ['09250000000', '0930000000'];
collect($data)->whereMec()->toArray(); 
// ['0930000000']

$data = [
    ['phone' => '09250000000'],
    ['phone' => '0930000000']
];
collect($data)->whereMec('phone')->toArray();
/*
    [
        ['phone' => '0930000000']
    ]
*/

whereMytel()

$data = ['09250000000', '09690000000'];
collect($data)->whereMytel()->toArray(); 
// ['09690000000']

$data = [
    ['phone' => '09250000000'],
    ['phone' => '09690000000']
];
collect($data)->whereMytel('phone')->toArray();
/*
    [
        ['phone' => '09690000000']
    ]
*/

uniToZg()

$data = ['မြန်မာပြည်'];
collect($data)->uniToZg()->toArray(); 
// ['ျမန္မာျပည္']

$data = [
    ['name' => 'မြန်မာပြည်']
];
collect($data)->uniToZg('name')->toArray();
/*
    [
        ['name' => 'ျမန္မာျပည္']
    ]
*/

zgToUni()

$data = ['ျမန္မာျပည္'];
collect($data)->zgToUni()->toArray(); 
// ['မြန်မာပြည်']

$data = [
    ['name' => 'ျမန္မာျပည္']
];
collect($data)->zgToUni('name')->toArray();
/*
    [
        ['name' => 'မြန်မာပြည်']
    ]
*/

Request

Check Unicode Font

$request->isUnicodeFont('မြန်မာပြည်'); // return true

Check Zawgyi Font

$request->isZawgyiFont('ျမန္မာျပည္'); // return true

Detect Myanmar Font

$request->detectMyanmarFont('မြန်မာပြည်'); // return 'unicode'
$request->detectMyanmarFont('ျမန္မာျပည္'); // return 'zawgyi'

Convert Zawgyi to Unicode

$request->zgToUni('ျမန္မာျပည္'); // return 'မြန်မာပြည်'

Convert Unicode to Zawgyi

$request->uniToZg('မြန်မာပြည်'); // return 'ျမန္မာျပည္'

Check Myanmar Phone Number

$request->isMyanmarPhoneNumber('09250000000'); // return true

Check MPT

$request->isMpt('09250000000'); // return true

Check Ooredoo

$request->isOoredoo('09970000000'); // return true

Check Telenor

$request->isTelenor('09790000000'); // return true

Check MEC

$request->isMec('0930000000'); // return true

Check Mytel

$request->isMytel('09690000000') // return true

Get Telecom Name

$request->telecomName('09251234567'); // return 'mpt'
$request->telecomName('09970000000'); // return 'ooredoo'
$request->telecomName('09790000000'); // return 'telenor'
$request->telecomName('0930000000');  // return 'mec'
$request->telecomName('09690000000'); // return 'mytel'

Version History

  • 1.2
    • added collection macros
    • improved zawgyi detection
  • 1.1
    • added request macros
  • 1.0
    • initial release

Credits

You might also like...
Add Social Reactions to Laravel Eloquent Models. It lets people express how they feel about the content. Fully customizable Weighted Reaction System & Reaction Type System with Like, Dislike and any other custom emotion types. Do you react? A laravel Livewire Dynamic Selects with multiple selects depending on each other values, with infinite levels and totally configurable.
A laravel Livewire Dynamic Selects with multiple selects depending on each other values, with infinite levels and totally configurable.

Livewire Combobox: A dynamic selects for Laravel Livewire A Laravel Livewire multiple selects depending on each other values, with infinite levels of

A powerful form builder, for Laravel and other frameworks (stand-alone too)

Former A Laravelish way to create and format forms Former outputs form elements in HTML compatible with your favorite CSS framework (Bootstrap and Fou

Base library for repeated layout fields, content builders and other collection components

laravel-flexible-content This package's only purpose is to build custom repeated layout components, such as Laravel Nova's Flexible Content field or y

Laravel Inspector, debugging and profiling tools for Web Artisans

Laravel Inspector At a Glance Installation Configuration Usage Messages Timers Redirects Dump and die Exceptions VIEW/AJAX/API requests, how it works

Laravel is accessible, powerful, and provides tools required for large, robust applications.

Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be trul

Laravel lsp - Developer tools for easier Laravel development
Laravel lsp - Developer tools for easier Laravel development

Laravel lsp The Laravel/Blade lsp provides: Blade: Diagnostics on missing components + action to create it. Autocomplete for components and their argu

A Simple PHP Renderer for Slim 3 (or any other PSR-7 project)

PHP Renderer This is a renderer for rendering PHP view scripts into a PSR-7 Response object. It works well with Slim Framework 4. Cross-site scripting

Open source for selling social media accounts or accounts on other platforms.

SELLACC - Open Source Selling Accounts SELLACC is open source for selling social media accounts or accounts on other platforms. ⚠️ We not update sourc

Releases(v2.4.0)
Owner
Pyae Sone Aung
A Web Developer
Pyae Sone Aung
This package provides convenient methods for making token code, sending and verifying mobile phone verification requests.

Laravel Mobile Verification Introduction Many web applications require users to verify their mobile phone numbers before using the application. Rather

M.Fouladgar 347 Dec 25, 2022
A laravel package for sending otp to mobile phone

A laravel package for sending otp to mobile phone Installation composer require gabbyti/bulksmsnigeria-otp Vendor Publish This package includes a conf

Gabriel 3 May 10, 2021
Phone number functionality for Laravel

Laravel Phone Adds phone number functionality to Laravel and Lumen based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents

null 2.1k Dec 31, 2022
Laravel Dutch Phone Number Validator

Laravel Dutch Phone Number Validator Validate if the given phone number is a valid Dutch phone number Table of Contents Installation Usage Translation

Tim Wassenburg 0 May 30, 2022
Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey.

Laravel Phone Adds phone number functionality to Laravel based on the PHP port of Google's libphonenumber API by giggsey. Table of Contents Demo Insta

null 2.1k Jan 2, 2023
Adds phone number functionality to TYPO3 based on the PHP port of Google's libphonenumber API by giggsey

TYPO3 Phone Adds phone number functionality to TYPO3 based on the PHP port of Google's libphonenumber API by giggsey. Installation composer require si

Simon Schaufelberger 3 Oct 25, 2022
Laravel Proxy Package for handling sessions when behind load balancers or other intermediaries.

Laravel Trusted Proxies Setting a trusted proxy allows for correct URL generation, redirecting, session handling and logging in Laravel when behind a

Chris Fidao 7.3k Jan 4, 2023
Laravel package for manage your URL redirects in database or other sources to get better SEO results

Laravel 8 and 9 package to manage URL redirections inside your Laravel application using different data sources. It allows a better SEO support for your Laravel site.

Siro Díaz Palazón 51 Sep 21, 2022
SEO Helper is a package that provides tools and helpers for SEO (Search Engine Optimization).

SEO Helper By ARCANEDEV© SEO Helper is a package that provides tools and helpers for SEO (Search Engine Optimization). Feel free to check out the rele

ARCANEDEV 301 Nov 25, 2022
Collection of agnostic PHP Functions and helpers with zero dependencies to use as foundation in packages and other project

Collection of agnostic PHP Functions and helpers This package provides a lot of very usefull agnostic helpers to use as foundation in packages and oth

padosoft 54 Sep 21, 2022