Giter Site home page Giter Site logo

laravel-phone's People

Contributors

achinthas avatar ashnewmanjones avatar ayesh avatar bperel avatar carlos-ea avatar choowx avatar dhpandya avatar dwightwatson avatar egorgruzdev avatar giggsey avatar gounlaf avatar hannesvdvreken avatar jgrossi avatar lloricode avatar lukeraymonddowning avatar mabdullahsari avatar mikemand avatar mwnciau avatar propaganistas avatar scybulski avatar sevannerse avatar simonschaufi avatar skylerkatz avatar stevebauman avatar vinkla avatar xfxf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-phone's Issues

Formatting with "auto-discovery"

Hello, I'd like to use the formatter like the validator with auto-discovery and fallback countries

phone($phone_number, $country_code = "AUTO,CH,...", $format = PhoneNumberFormat::INTERNATIONAL)

So, I want to store fomatted phone numbers in my database without using the "country" field. Because I already have a country field in my database and I also use it as last fall-back method. And I don't want to annoy or confuse any people by asking the country again. It would be a very nice addition.

Can we keep up with libphonenumber-for-php versions?

laravel-phone is awesome! Just a tiny suggestion: According to composer.json it depends on libphonenumber-for-php 5.9.*, which seems to equate to 5.9.4 from February in my installation. Can we keep up with 6.x versions (currently 6.1.1), or will laravel-phone seize to work with versions newer than 5.9?

Validation issue

I think there might be a problem with validation. I want to write validation for phone number ( for ex. +91 12345674890) and it works fine but the problem is whenever a user enters any two characters after a mobile number (for ex. +91(1234567891) bd ) it treats as a valid phone number. Please give me appropriate solution.

Thanks in advance.

custom output format

Hello,

I was wondering. This lib is really nice for validation.
But for example I need an output format like:

+1.123456
so in general:
+COUNTRY_CODE then PERIOD then PHONE NUMBER.

Does this library allows this?

Warning: Loaded on every request

Maybe you should add a disclaimer to warn people that this package is loaded on every request, along with the packages it requires itself like Translation, causing a significant slowdown of runtime.

Many people just need this on a few pages, in that case they would probably be better off with a simple regex or with an adaptation of your package to handle autoloading more efficiently.

Anyway, thanks for sharing!

Getting :value on custom messages

Could you add a replacer so :value becomes available from the custom message?

 $validator->addReplacer('phone', function ($message, $attribute, $rule, $parameters) use ($value) {
        return str_replace(':value', $value, $message);
    });

This allows:
"phone" => "The number :value is invalid.",

Thanks.

manually validation

Can I validate number manually, I don't see this in the documentation?

Why this is false

dd(PhoneNumber::isValidFormat('+17025891156'));

?

In Laravel 5.4, it is throwing the error instead of returning as validation failure message

Basically, my validation rule is defined as $rules = ['mobile_number'=>'required|phone:IN,mobile']
when the input is

  1. +919900990099 - validation passes
  2. +919900 - I validation failed with error message The mobile number field contains an invalid number.
  3. +919 - I get exception

NumberParseException in PhoneNumberUtil.php line 1477: The string supplied is too short to be a phone number.

  1. when empty value is passed - I get exception

NumberParseException in PhoneNumberUtil.php line 1381: The phone number supplied was null.

I am expecting the Exception messages to be returned as validation error messages.

Hope reporting the issue help improving this lovely package.

Empty country field throws Exception

Hi,

I have a problem when receiving an empty value for a country code. The InvalidParameterException error is thrown but it should not be the case.

I think on line 114 of PhoneValidator.php, the line should be:
if (!is_null($this->isInputField($parameter))) {

Does that seem right?

Thanks.

Problems with `GB` number [v3.0.3]

Psy Shell v0.8.14 (PHP 7.1.11 — cli) by Justin Hileman

>>> $number = phone('447937947973', 'GB');
=> Propaganistas\LaravelPhone\PhoneNumber {#907}
>>> $number->getCountry();
Propaganistas\LaravelPhone\Exceptions\NumberParseException with message 'Country specification for number "447937947973" required.'

>>> $number = phone('12252280247', 'US');
=> Propaganistas\LaravelPhone\PhoneNumber {#935}
>>> $number->getCountry();
=> "US"

What am I doing wrong?

custom_country_field not validatable

I not able to validate on custom_country_field Rule alpha|size:2 not apply on this field

'phonefield'            => 'phone:custom_country_field',
'custom_country_field'  => 'required_with:phonefield|alpha|size:2',

Storing in database

What would be the correct way to store phone + country code in DB?

Currently thinking to seperate country_code and phone_number

        $table->string('phone_country_code')->nullable();
        $table->string('phone_number')->nullable();

However, brings me to questions such as:

  • What about unique validation? If this is separated into two columns it would be harder to validate.
  • Fetching a user by a provided phone number would be a bit more difficult than simply doing ->wherePhone($phoneNo)

How are you guys storing?

Manually validate phones

Hello,

I'd like to validate phone numbers I already have in my database, in order to fix the wrong ones.

How can I achieve this ?
I can't figure out how to call isValidNumber manually.

Can you help, please ?

problem with belgian fixed line phone number for area 04

Hi,

phone validation (phone:BE) fails with this number : +32 4 799 70 15
but works if I add a number at the end
or with those one : +32 4 199 70 15 - +32 4 299 70 15 - +32 4 399 70 15

to resume:

works if

  • first digit after +32 4 is 1, 2 or 3
  • if I add a number at the end (thus entering mobile phone number ;) )

fails if

  • first digit after +32 4 is 0,4,5,6,7,8,9

Can you please correct this? :)

Thanks a lot,

pudeldoodle

Could not interpret numbers after plus-sign.

This issue does not happen with 2.5.0

NumberParseException in PhoneNumberUtil.php line 1378:
Could not interpret numbers after plus-sign.
in PhoneNumberUtil.php line 1378
at PhoneNumberUtil->parseHelper('+04(6)7912844048', 'US', false, true, object(PhoneNumber)) in PhoneNumberUtil.php line 2673
at PhoneNumberUtil->parse('+04(6)7912844048', 'US') in helpers.php line 18
at phone_format('+04(6)7912844048', 'US') in 5678c1f644f72cac8fb1af3360688d937637a2f8.php line 29
at include('C:\laragon\www\inventory\storage\framework\views\5678c1f644f72cac8fb1af3360688d937637a2f8.php') in PhpEngine.php line 42
at PhpEngine->evaluatePath('C:\laragon\www\inventory\storage\framework\views/5678c1f644f72cac8fb1af3360688d937637a2f8.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'people' => object(Collection))) in CompilerEngine.php line 59
at CompilerEngine->get('C:\laragon\www\inventory\resources\views/person/index.blade.php', array('__env' => object(Factory), 'app' => object(Application), 'errors' => object(ViewErrorBag), 'people' => object(Collection))) in View.php line 135
at View->getContents() in View.php line 106
at View->renderContents() in View.php line 80
at View->render() in Response.php line 52
at Response->setContent(object(View)) in Response.php line 197
at Response->__construct(object(View)) in Router.php line 1030
at Router->prepareResponse(object(Request), object(View)) in ControllerDispatcher.php line 95
at ControllerDispatcher->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in ControllerDispatcher.php line 96
at ControllerDispatcher->callWithinStack(object(PersonController), object(Route), object(Request), 'index') in ControllerDispatcher.php line 54
at ControllerDispatcher->dispatch(object(Route), object(Request), 'App\Http\Controllers\PersonController', 'index') in Route.php line 174
at Route->runController(object(Request)) in Route.php line 140
at Route->run(object(Request)) in Router.php line 703
at Router->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Authenticate.php line 28
at Authenticate->handle(object(Request), object(Closure))
at call_user_func_array(array(object(Authenticate), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in VerifyCsrfToken.php line 64
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in ShareErrorsFromSession.php line 49
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in StartSession.php line 62
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in EncryptCookies.php line 59
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Router.php line 705
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 678
at Router->dispatchToRoute(object(Request)) in Router.php line 654
at Router->dispatch(object(Request)) in Kernel.php line 246
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 52
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103
at Pipeline->then(object(Closure)) in Kernel.php line 132
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 99
at Kernel->handle(object(Request)) in index.php line 54

"Lenient" parameter implemented (code attached)

Hi,

Please see:
xfxf@ec03230

I added a parameter called "LENIENT" to expose more lenient phone number validation (in our case, area codes being optional) in the library you're relying on.

This code works; we're using it on a project right now.

I see you've refactored parts of this since the commit I based this off; I'm happy to update the code to reflect a PR against your latest commit, but probably be good to get feedback from you first.

fixed_line_or_mobile

Hi,

Thanks for making this library!

Maybe it's a configuration error on my side, but if I use the "fixed_line_or_mobile" number constraint, all numbers are invalid.

$this->validate($request, [
    'phone_number' => 'required|phone:CH,fixed_line_or_mobile',
])

But if I use booth everything works as expected (mobile and fixed_line numbers are valid):

$this->validate($request, [
    'phone_number' => 'required|phone:CH,fixed_line,mobile',
])

Did I miss something?

I can not figure out, why I do not get erros back, and also old input if form is not validated

I can not figure out, why I do not get erros back, and also old input if form is not validated

If I leave empty phone field I get:

NumberParseException in PhoneNumberUtil.php line 1383:
The string supplied did not seem to be a phone number.

If I enter letters I get

NumberParseException in PhoneNumberUtil.php line 1383:
The string supplied did not seem to be a phone number.
                                    <div class="col-md-6 pl-none">
                                        <label for="phonefield" >Phone</label>
                                        <input name="phonefield" id="phonefield" type="phone" class="form-control input-lg" {{ $errors->has('phonefield') ? ' autofocus' : '' }}>
                                        @if ($errors->has('phonefield'))
                                            <span class="help-block">
                                                <strong>{{ $errors->first('phonefield') }}</strong>
                                            </span>
                                        @endif
                                    </div>
    protected function validator(array $data)
    {
            $phonefield = phone_format($data['phonefield'], $country_code = 'LV', $format = PhoneNumberFormat::E164);
        return Validator::make($data, [
            'name' => 'required|max:255',
            'email' => 'required|email|max:255|unique:users',
            'phonefield' => 'phone:LV|unique:users',
            ]);
    }

Also I added in validation.php

    'phone'                => 'The :attribute field contains an invalid number.',

What I am doing wrong?

Detected Country field name configurable?

Is it possible to configure the name of the Country field? Using phone_country as my field name does not make any sense (and does not fit in with my database design).

Upgrade to newer libphonenumber

Hi could you update the version of the libphonenumber referenced in composer.json.
A new version 7.* is out and although I haven't tested it, I don't think it breaks backwards compatibility.

Keep up the good work 👍 .

Version 2.4.2 misfiring on Laravel 4.2

Hello,

Thank you for your work on this project. I have run into an issue when trying to integrate this with my site. When I attach the phone rule to my form. It seems to just continually return that it's in error, though I'm using my personal phone number. Please let me know what information you need from me and I will do all I can to help.

Thanks!

Is Laravel-Phone Working Properly

This does not validate 1112224444, sometimes
This does valadate 111-aaa-4444, sometimes
This does validate 111-222-4444, sometimes

Using Laravel 5.5.21

Method [validatePhone] does not exist

When adding in the phone validation to my rules I get the following exception:

BadMethodCallException in Validator.php line 2615:
Method [validatePhone] does not exist.

Error Occur Undefined index: phone

Hi, I am new to laravel. Currently using 5.4 version. After following the readme, I encounter

ErrorException in RegisterController.php line 71: Undefined index: phone

Kindly help.

Eloquent mutator of phone cause the model isDirty always return true

I have the phone attribute on User model which currently use this package for phone formatting via Eloquent mutator and accessor like so

User Model

public function getPhoneAttribute($value)
{
    return phone($value)->formatForCountry('VN');
}

public function setPhoneAttribute($value)
{
    return $this->attributes['phone'] = phone($value, 'VN');
}

While perfoming update request to the controller with no changes the phone attribute still getting updated with same attribute. This occur even if the getPhoneAttribute method removed.

UserController

public function update(UpdateProfileRequest $request)
{
    $request->user()->update($request->all());
    return redirect()->back();
}

So it seem that the Model is know the phone attribute has been dirtied even if it is not?

Validation inside a request object?

Hello,

I've used the validation rule perfectly while using the validation request inside a controller, but now that I'm moving said rules under their own requests object (artisan make:request), the phone:Country validation rule doesn't seems to work.

Is there anything I should do to make it work there?

v3.0.4 Laravel 5.5 validation

Laravel 5.5 validation rule of 'phone:GB' is validating as though it is a required field. If the field is empty it is still validating.

2.4.1 not working with Laravel 4.2

Hi there, 2.4.1 doesn't appear to be working with Laravel 4.2. Is this expected (documentation seems to indicate it should)?

Running phpunit against it comes up with a ton of errors;

PHPUnit 4.2.2 by Sebastian Bergmann.

EEEEEFF.

Time: 85 ms, Memory: 4.50Mb

There were 5 errors:

1) PhoneValidatorTest::testValidatePhoneWithDefaultCountryNoType
Argument 4 passed to Propaganistas\LaravelPhone\PhoneValidator::validatePhone() must be an instance of Illuminate\Contracts\Validation\Validator, instance of Illuminate\Validation\Validator given, called in /vagrant/vendor/propaganistas/laravel-phone/tests/TestPhoneValidator.php on line 35 and defined

/vagrant/vendor/propaganistas/laravel-phone/src/PhoneValidator.php:68
/vagrant/vendor/propaganistas/laravel-phone/tests/TestPhoneValidator.php:35
/vagrant/vendor/propaganistas/laravel-phone/tests/TestPhoneValidator.php:41

etc...

Illuminate\Contracts\Validation\Validator appears to have been introduced in Laravel 5.0.

Not working for BY mobile phone numbers

Phone number for example: +375 25 260 55 12 - is a mobile number for Belarus. (https://countrycode.org/belarus)
(https://en.wikipedia.org/wiki/List_of_mobile_phone_number_series_by_country - please search on page +375)

Rules:
'phone' => 'required|phone:AUTO' - not working
'phone' => 'required|phone:AUTO,mobile' - not working
'phone' => 'required|phone:BY' - not working
'phone' => 'required|phone:BY,mobile' - not working

Oh sorry - all working fine (+375 25 260 55 12 - this is a bad number)

international mobile no start with 00

'xxxxx => 'required|phone:AUTO,US,AE'
now i use validation rule like this and it works fine with +(country code)(mobile no)

but requirement is instead of +9 start with 00
how i can do this

Fallback country & country field are treated mutually exclusive

Hello, I have a problem with dev-3.0

I can't use this validation string anymore:

'phone_number' => 'required|phone:AUTO,CH,country',

this is fine:

'phone_number' => 'required|phone:AUTO,country',

this is also fine:

'phone_number' => 'required|phone:AUTO,country',

Where country is a select field with your other LaravelIntl library.

It did work with the older version.

The error:

(1/1) InvalidParameterException
Invalid phone validation parameters: "CH".


in InvalidParameterException.php (line 17)
--
at InvalidParameterException::parameters(object(Collection))in Phone.php (line 122)
at Phone->extractParameters('phone_number', array('AUTO', 'CH', 'country'), array('_token' => '***', '_method' => 'PATCH', 'title' => '***', 'old_customer_number' => null, 

...more fields...

 'country' => 'CH', 'phone_number' => '+41 ****')in Phone.php (line 47)
at Phone->validate('phone_number', '+41 ****', array('AUTO', 'CH', 'country'), object(Validator))

I censored the number with ****

So basically I can't use AUTO, Fallback Country AND Fallback secondary field.
(Also tested where Fallback country and Fallback field are different)

Main reason why I don't want to use a dedicated country field for phone number because I don't want to confuse customers with problaly "unnecessary" fields. Because most of our customers live in Switzerland and will most likely have a Swiss phone number anyway. But if not then I wan't to fallback to "their" country just for the sake of convenience. And if this does not pass I'll show an error, where they will be asked to add the country code to their number. I mean, I can leave this as is and only use one hardcoded country field... Or use the country as a fallback country... But this method seems the most convenient to me and it did work before... Maybe... At least it did not throw an error. :D
I hope you understand what I mean.

Am I doing something wrong here? Is it a bug? Is there a better way of doint things?

Extend checkCountries() to handle nested rule-sets

Hi there,

just discovered that the Validator doesn't handle nested validation rules like:
address.phone
address.phone_country

Flatening the Array in line 126 of PhoneValidator.php with:
$data = array_dot($validator->getData());
seems to fix the issue.

Maybe you can validate my findings and merge to master if correct.

Thanks,
volker

PhoneNumberUtil::getInstance() throwing The phone number supplied was null.

Hello,

When using the LaravelPhoneFacade or anytime I use PhoneNumberUtil::getInstace() in the consctructor of a Controller I'm getting a:
PHP Fatal error: Uncaught Error type: 1. The phone number supplied was null. thrown in PhoneNumberUtil.php on line 1376

This happens when I run artisan route:list for example.

Inputs named similar as phone types cause inconsistencies

I used to have the following validation rule:

'mobile'      => 'phone:NL,mobile',

As of 2.7 this no longer works as you check if the 'mobile' parameter is the input field, which in this case it is, and starts to assume I will have a custom_country_field.

Of course easily fixed by changing the name of the form field to something other than mobile, but imo this still is a bug as the form field name should have no consequences.

[Laravel 5.2] phone_format throws exception

I have the following code in laravel, but no matter what I do, it always throws an exception.
Exception:
NumberParseException in PhoneNumberUtil.php line 1348: Missing or invalid default region.

Route::get('/sms', function() {
    return phone_format('2025550115');
});

Validation Errors trying every format.

I'm doing form request validation and I tried using this package, but I can't seem to get it working, my validation looks like this :

<?php

namespace App\Http\Requests\Users;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Contracts\Validation\Validator;

class UserCreatePost extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
          'email' => ['required', 'email', 'unique:users'],
          'first_name' => ['required'],
          'last_name' => ['required'],
          'phone' => ['required', 'phone:CA', 'unique:users'],
        ];
    }

    protected function formatErrors(Validator $validator)
    {
        var_dump($validator->attributes());
        throw new StoreResourceFailedException('Could not create new user.', $validator->errors());
    }
}

I get

{
    "message": "Could not create new user.",
    "errors": {
        "phone": [
            "The phone field contains an invalid number."
        ]
    },
    "status_code": 422
}

I tried different format :
+1 123 456 7890
+1-123-456-7890
+1 (123) 456 7890
+1 (123) 456-7890
(123) 456-7890
+11234567890
Not working.
I added Propaganistas\LaravelPhone\LaravelPhoneServiceProvider::class, in my $providers.

Thanks for helping.

Support for Lumen

Hi,

Is there some support for Lumen?

When i use this in Lumen i get this error "FatalErrorException in Facade.php line 215: Call to undefined method Laravel\Lumen\Application::getLocale()".

libphonenumber-for-php v8 released

Hi,

libphonenumber-for-php v8 has been released, and it'll be good for this project to support it going forwards.

The BC changes are:

  • Convert from PSR-0 to PSR-4
  • Remove deprecated ShortNumberUtil, use ShortNumberInfo instead
  • Deleting deprecated methods in ShortNumberInfo that work on strings, instead
    of phone number objects. These have been marked deprecated for months. Any
    users of these methods should call PhoneNumberUtil::parse first to create a
    PhoneNumber object, and pass this in.
  • Support semicolon as extension character while parsing phone numbers.

Allow wildcard field parameters

Thanks again for putting this out there.

Laravel 5.2 now supports validation arrays, it looks like the phone validator doesn't take advantage of that yet, I'd like to be able to do this:

'something.*.phone' => 'phone:something.*.phone_country'

Similar to what is shown in the docs:

$validator = Validator::make($request->all(), [
    'person.*.email' => 'email|unique:users',
    'person.*.first_name' => 'required_with:person.*.last_name',
]);

https://laravel.com/docs/5.2/validation#validating-arrays

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.