update v1.0.4

This commit is contained in:
sujitprasad
2016-01-04 18:05:45 +05:30
parent 372485336b
commit 4864e5a3f1
529 changed files with 20956 additions and 8178 deletions

View File

@@ -1,8 +1,11 @@
<?php
use Illuminate\Support\Facades\App;
use libphonenumber\PhoneNumberFormat;
function phone_format($phone, $country, $format = null) {
$phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
$phoneProto = $phoneUtil->parse($phone, $country);
$format = is_null($format) ? \libphonenumber\PhoneNumberFormat::INTERNATIONAL : $format;
return $phoneUtil->format($phoneProto, $format);
$lib = App::make('libphonenumber');
$phoneNumber = $lib->parse($phone, $country);
$format = is_null($format) ? PhoneNumberFormat::INTERNATIONAL : $format;
return $lib->format($phoneNumber, $format);
}