mercredi 24 juillet 2019

Laravel Validation : how to set 'required_if' and 'integer'

I have two field qty, status I want to set a rule qty must 'integer' qty required when status is 0. qty can be empty when status is 1 I try to set rules as below

[
    'qty' => 'integer|required_if:status,0',
    'status' => 'required|integer|between:0,1'
]

But I don't know why when status is 1, do not show required error, but show integer error.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/30U2qE6
via IFTTT

Aucun commentaire:

Enregistrer un commentaire