Tuesday, March 21, 2017

Larave 5.4 required if validation issue

I have 2 fields, accepts_usd and price_usd.

For price usd i have a validation rule:

'price_usd'=>'integer|required_if:accepts_usd,1',

And for accepts_usd:

'accepts_usd'=>'boolean|required',

When I want to store data if I set accepts_usd to false it still asks for price_usd.

whats the issue here? What am I doing wrong?

Thanks!



via user3844579

Advertisement