This will require some custom validation. See https://stackoverflow.com/questions/50349775/laravel-unique-validation-on-multiple-columns
Validate against three fields
Hello.
I have a somewhat unique case. I have three fields in my database table. Separately, these three fields can have duplicates in the table. However, together, the three fields need to be unique. So, if Field1 has A and Field two Has B and Field has C, then no other record can have "ABC" in those fields together. However "ABD" would be ok, since those three together are unique.
I've been trying to come up with a validation rule for this but am stuck. I did create an attribute in the database to combine the three fields together, but I don't see how that will really help me with this validation rule.
Any suggestions would be greatly appreciated!
Thanks!
Please or to participate in this conversation.