How to create really unique Repeater
Hi, all! We have repeater with some field, let's say 'name'. This name should be unique. So if we add several items of repeater and try to fill name field in some of them with non unique value - it shouldn't pass validation. What s the best way to do something like that?
4 Replies
@idpry Thanks a lot! It really helped me to get the message that the name is not unique, but it still doesn't block saving of my form. Do you have some idea why it happens?
Do you have a validation rule for the repeater? You can validated that items in an array are unique. Have a look at Laravel’s validation rules.
@awcodes Thank you! It gave me direction and I deсided to use livewire Error bag in the rule.