Skip to content

Tag: validation

Laravel unique validation on multiple columns

I have 2 columns in table servers. I have columns ip and hostname. I have validation: This working only for column ip. But how to do that it would work and for column hostname? I want validate data.ip with columns ip and hostname. Because can be duplicates in columns ip and hostname, when user write ip. Answe…

Laravel validate at least one item in a form array

I have a form with a series of numbers in an array: I would like to validate that there is at least one of those input fields that has a value. I tried the following in my OrderCreateRequest, yet the test is passing: Am I missing something? Answer I think you need a custom validation rule like the following b…