5
'tipo' => 'required',
'cpf' => 'required_if:tipo,F|cpf',
'rg' => 'required_if:tipo,F',
'cnpj' => 'required_if:tipo,J|cnpj',
'inscricao_estadual'=> 'required_if:tipo,J',
Next, I’m wearing this required if
, and when the request comes with type 'J' it validates in Cpf, how to solve?
What exactly happens is perhaps the second validation he performs!
– novic
but there is a way for required if to extend to Cpf. Because when type is 'J' I don’t want it to validate Cpf.
– Wildenis