update v 1.0.7.5
This commit is contained in:
15
vendor/propaganistas/laravel-phone/README.md
vendored
15
vendor/propaganistas/laravel-phone/README.md
vendored
@@ -63,11 +63,16 @@ To validate a field using the phone validator, use the `phone` keyword in your v
|
||||
|
||||
The validator will check if the number is valid in at least one of provided countries, so feel free to add as many country codes as you like.
|
||||
|
||||
- You don't specify any parameters but you plug in a dedicated country input field (keyed by *ISO 3166-1 compliant* country codes) to allow end users to supply a country on their own. The easiest method by far is to install the [CountryList package by monarobase](https://github.com/Monarobase/country-list). The country field has to be named similar to the phone field but with `_country` appended:
|
||||
- You don't specify any parameters but you plug in a dedicated country input field (keyed by *ISO 3166-1 compliant* country codes) to allow end users to supply a country on their own. The easiest method by far is to install the [CountryList package by monarobase](https://github.com/Monarobase/country-list). Make sure the country field is named similar as the phone field but with *_country* appended for automatic discovery, or provide your custom country field name as a parameter to the validator:
|
||||
|
||||
```php
|
||||
'phonefield' => 'phone',
|
||||
'phonefield_country' => 'required_with:phonefield',
|
||||
'phonefield' => 'phone',
|
||||
'phonefield_country' => 'required_with:phonefield',
|
||||
```
|
||||
|
||||
```php
|
||||
'phonefield' => 'phone:custom_country_field',
|
||||
'custom_country_field' => 'required_with:phonefield',
|
||||
```
|
||||
|
||||
If using the CountryList package, you could then use the following snippet to populate a country selection list:
|
||||
@@ -101,7 +106,7 @@ You can also enable more lenient validation (for example, fixed lines without ar
|
||||
Format a fetched phone value using the helper function. `$country_code` is the country the phone number belongs to.
|
||||
|
||||
```php
|
||||
phone_format($phone_number, $country_code, $format = PhoneNumberFormat::INTERNATIONAL)
|
||||
phone_format($phone_number, $country_code = null, $format = PhoneNumberFormat::INTERNATIONAL)
|
||||
```
|
||||
|
||||
If no `$country_code` was given, the current application locale will be used as default.
|
||||
The `$format` parameter is optional and should be a constant of `libphonenumber\PhoneNumberFormat` (defaults to `libphonenumber\PhoneNumberFormat::INTERNATIONAL`)
|
||||
|
||||
Reference in New Issue
Block a user