Update v1.0.6.5

This commit is contained in:
sujitprasad
2016-03-02 12:25:21 +05:30
parent 7011553462
commit c56ff86194
218 changed files with 17161 additions and 2358 deletions

View File

@@ -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)

View File

@@ -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])) {

View File

@@ -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();