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
Solution:
->requiredUnless(statePath: 'data.passenger_type', stateValues: 'self', isStatePathAbsolute: true)
->requiredUnless(statePath: 'data.passenger_type', stateValues: 'self', isStatePathAbsolute: true)
...
Jump to solution
3 Replies
mohdaftab
mohdaftabOP5mo ago
Please can somebody help with this issue ?
Solution
LeandroFerreira
LeandroFerreira5mo ago
->requiredUnless(statePath: 'data.passenger_type', stateValues: 'self', isStatePathAbsolute: true)
->requiredUnless(statePath: 'data.passenger_type', stateValues: 'self', isStatePathAbsolute: true)
mohdaftab
mohdaftabOP5mo ago
thank you, let me try this. Perfect, thank you so much. please let me know where is this mentioned in the documentation?
Want results from more Discord servers?
Add your server