Repeater requiredIf validation from the field outside of repeater
Hello,
I am trying to make requiredUnless if the TextInput (outside of Repeater) has a certain value but it doesn't work, Please let me know how can I make this validation work?
Repeater::make("passenger_details")
->grid(2)
->schema([
TextInput::make("first_name")
->requiredUnless('passenger_type', 'self'),
TextInput::make("last_name")
->requiredUnless('passenger_type', 'self'),
TextInput::make("email")
->email(),
TextInput::make("phone")
->tel(),
])
Also I tried $get('passenger_type') inside the repeater and the passenger_type input is outside of the repeater.
Thank you
3 Replies
Please can somebody help with this issue ?
Solution
thank you, let me try this.
Perfect, thank you so much.
please let me know where is this mentioned in the documentation?