update v 1.0.7.5

This commit is contained in:
Sujit Prasad
2016-06-13 20:41:55 +05:30
parent aa9786d829
commit 283d97e3ea
5078 changed files with 339851 additions and 175995 deletions

View File

@@ -4,19 +4,24 @@ use Illuminate\Support\Facades\App;
use libphonenumber\PhoneNumberFormat;
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);
/**
* 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 = null, $format = PhoneNumberFormat::INTERNATIONAL)
{
$lib = App::make('libphonenumber');
return $lib->format($phoneNumber, $format);
}
if (!$country) {
$country = App::getLocale();
}
$phoneNumber = $lib->parse($phone, $country);
return $lib->format($phoneNumber, $format);
}
}