Comments (3)
I hate to say but I can't reproduce the issue you're facing.
$data = ['notificationchannelid' => 0];
$validator = validator($data, [
'phone_mobile' => ['required_if:notificationchannelid,0', 'phone:DE,CH,AU'],
]);
$validator->errors(); // The phone_mobile field is required when notificationchannelid is 0.
There must be something else going on in your code... For example: are you sure notificationchannelid
is really "0"?
from laravel-phone.
OK, my mistakes in the explanation.
phone also throws an error when the ID is 1.
from laravel-phone.
Oh but it sure works...
$data = ['notificationchannelid' => 1];
$validator = validator($data, [
'phone_mobile' => ['required_if:notificationchannelid,0', 'phone:DE,CH,AU'],
]);
$validator->errors(); // []
$validator->passes(); // true
// No error thrown
See test:
Laravel-Phone/tests/PhoneValidatorTest.php
Lines 463 to 469 in 3de645c
from laravel-phone.
Related Issues (20)
- Validation error HOT 1
- Number does not match the provided country. (NumberParse Exception) HOT 1
- parseHelper() method of PhoneNumber class didn't implement HOT 3
- Fails to validate phone numbers when the country code is lowercase HOT 2
- Fails to validate international swedish numbers HOT 6
- Dialing Codes HOT 2
- Your demo site seems broken HOT 1
- InvalidArgumentException : Missing country specification for phone attribute cast HOT 8
- How to only accept international format (E.164) for a specific country? HOT 2
- GH valid phone number starting with 025xxxxxxx fails validation, however 0256 works
- Validation for Lebanese mobile numbers starting with 78 fails HOT 1
- When I used it, I found that the getCountryCode method was missing HOT 1
- Documented formatE164 method does not return expected result HOT 1
- Validation Message HOT 1
- how do i use AUTO with the class interface? HOT 1
- Failed to open stream: No such file or directory in /propaganistas/laravel-phone/src/Concerns/PhoneNumberFormat.php HOT 3
- "mobile" parameter no longer working in 5.1.0 when one of the data fields is "mobile" HOT 2
- Support for Laravel 11 HOT 1
- Laravel-Intl is unavailable HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-phone.