update v1.0.4
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user