requiredWithout validation
I am trying to run a requiredWithout validation rule, I want contact number to be required if email is null. The issue I am having is that contact number is inside the schema of a fieldset that is from the profile model. Where as email is on user directly.
This is my current attempt. But getting this error: An attempt was made to evaluate a closure for [Filament\Forms\Components\TextInput], but [$form] was unresolvable.
If I just have the requiredWithout('email') the validation is looking for data.profile.email which is incorrect as email isn't in profile, and if I call user.email its then searching data.profile.user.email
1 Reply
if I have it as requiredWithout($form->getComponent()) that also wont work, as getComponents is an empty array?
Also tried Get, but 'email' returns null. Model is no use as that is likely to only check for a value on the model relation rather than the input field?
Anyone have any ideas what im missing?
SO once again, it must be the path, so state path is data.email. But its giving "required when data.profile.data.email". So how can I tell it to look outside of this relationship fieldset?
OH I COULD CRY.... I just needed to pass the absoluteStatePath boolean value