This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

phplee
phplee

I have a 'registrants' json field which I'm using a repeater to store multiple registrants. i.e. first name, last name etc. but i need to validate them.

How do add validation to my repeater fields.

Thanks

Renatio
Renatio

Hi,

you can try to override create and update method and create there a custom Validator for each registrants. Here is how to do this: http://stackoverflow.com/questions/29952448/validate-array-laravel-5

Another aproach will be to create custom validation rule: https://laravel.com/docs/5.0/validation#custom-validation-rules

In Laravel 5.2 this will significantly simpler: https://laravel.com/docs/5.2/validation#validation-quickstart (look for Validating Arrays).

phplee
phplee

thanks will take a look

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.