update v1.0.6

This commit is contained in:
sujitprasad
2016-02-16 22:42:08 +05:30
parent e6b579d67b
commit 073a49a8af
587 changed files with 21487 additions and 22766 deletions

View File

@@ -3,9 +3,20 @@
use Illuminate\Support\Facades\App;
use libphonenumber\PhoneNumberFormat;
function phone_format($phone, $country, $format = null) {
$lib = App::make('libphonenumber');
$phoneNumber = $lib->parse($phone, $country);
$format = is_null($format) ? PhoneNumberFormat::INTERNATIONAL : $format;
return $lib->format($phoneNumber, $format);
if (!function_exists('phone_format')) {
/**
* Formats a phone number and country for display.
*
* @param string $phone
* @param string $country
* @param int|null $format
* @return string
*/
function phone_format($phone, $country, $format = PhoneNumberFormat::INTERNATIONAL)
{
$lib = App::make('libphonenumber');
$phoneNumber = $lib->parse($phone, $country);
return $lib->format($phoneNumber, $format);
}
}