-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dependsOn for siblings #61
base: main
Are you sure you want to change the base?
Conversation
Can depends on work for sibling depennds on filed outside simple repeatable? Select::make('Test'); |
@laravelwebdev if I remember correctly while testing, that feature should be available out-of-the-box, but it begs the question of what happens with your repeatable fields. Because if you added 10 fields, and then change |
Created functionality to enable
dependsOn
for siblings.Disclaimer: I haven't tested the feature extensively in each and every scenario, so if anyone else would benefit from this feature, please try it out and let me know if it fails somewhere.
Copying usage instructions I wrote in the readme:
dependsOn()
function is made available for fields within theSimpleRepeatable
. To make the feature available, be sureto use
DependsOnSiblings
trait on the resource you want to havedependsOn()
available for sibling fields.Key on which the field depends on is constructed out of two parts:
{parent attribute}.{child attribute}
. This keywill be made available to fetch within the function via
$request->get('parent.child')
.Example: