2
Through site collaborators I managed to ask a question Do a custom validation on Laravel 5 on validation in Laravel, where it was possible, validate a field input
text
only if a Combobox was checked.
Example:
required_if
:anotherfield
,value
And now another question has arisen, I have several fields name, which is a input
text
nomes = nome[] (array)
, then in the above case it does not accept in the validation, since even being empty, he considers existing due to the existence of the array
There’s a way to do it?
place an example of
input
would be<input type="text" name="nome[]"/>
??? and all possible information of the doubt. Note that my edition made reference to your first doubt, which was taken, and with mention of a new doubt!– novic
It is as follows: I have several inputs to register several partners of the company, all fields have the name = name[], that is, when I do a get in the name field, it comes as an array of names, according to the number of fields name[] filled in... But when I do the validation by : >required_if: ... It does not work, and even though no name has been filled in, it passes through and does not accuse in validation ... I imagine this happens because when the array of names is passed to validation, Request accuses that it is ok because there is value (which is the array), but it does not check whether the array has value
– Fernando Herique Rubim Pioli