PHP code example of fawkescreatives / myanmar-phone

1. Go to this page and download the library: Download fawkescreatives/myanmar-phone library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fawkescreatives / myanmar-phone example snippets


/*
 * Package Service Providers...
 */

MyanmarPhone\MyanmarPhoneServiceProvider::class,

use MyanmarPhone\MyanmarPhone;

public function index(MyanmarPhone $service)
{
    $phone = '09251234567';

    return $service->make($phone)->getPhoneNumber();
}

use MyanmarPhone\Facades\MyanPhone;

public function index()
{
    $phone = '09251234567';
        
    return MyanPhone::make($phone)->getPhoneNumber();
}

Validator::make($data, [
    'phone_number' => [
        'myanmar_phone'
    ],
]);

MyanPhone::make($phone)->format(2); // look format number in config
bash
php artisan vendor:publish --provider="MyanmarPhone\MyanmarPhoneServiceProvider"