Update v1.0.6.5
This commit is contained in:
2
vendor/propaganistas/laravel-phone/README.md
vendored
2
vendor/propaganistas/laravel-phone/README.md
vendored
@@ -98,7 +98,7 @@ You can also enable more lenient validation (for example, fixed lines without ar
|
||||
```
|
||||
|
||||
### Display
|
||||
Format a fetched phone value using the helper function:
|
||||
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)
|
||||
|
||||
@@ -123,7 +123,7 @@ class PhoneValidator
|
||||
*/
|
||||
protected function checkCountries($attribute, $validator)
|
||||
{
|
||||
$data = $validator->getData();
|
||||
$data = array_dot($validator->getData());
|
||||
$countryField = $attribute . '_country';
|
||||
|
||||
if (isset($data[$countryField])) {
|
||||
|
||||
@@ -18,8 +18,16 @@ class PhoneValidatorTest extends TestCase
|
||||
private function performValidation($data)
|
||||
{
|
||||
$rule = 'phone' . (isset($data['rule']) ? ':' . $data['rule'] : '');
|
||||
$validator = $this->validator->make(
|
||||
array_only($data, ['field', 'field_country']), ['field' => $rule]
|
||||
|
||||
$input = array_only($data, ['field', 'field_country']);
|
||||
$input['nested']['field'] = $input['field'];
|
||||
if (isset($input['field_country'])) {
|
||||
$input['nested']['field_country'] = $input['field_country'];
|
||||
}
|
||||
|
||||
$validator = $this->validator->make($input,
|
||||
['field' => $rule,
|
||||
'nested.field' => $rule]
|
||||
);
|
||||
|
||||
return $validator->passes();
|
||||
|
||||
Reference in New Issue
Block a user