alexwenzel / nova-dependency-container

A Laravel Nova field container allowing to depend on other fields values
MIT License
46 stars 33 forks source link

feature request: dependsOnCallback #33

Open otrsw opened 1 year ago

otrsw commented 1 year ago

Firstly thank you for maintaining this component and adding the Nova 4 support. Much appreciated!

I would like to request a feature to allow for more flexible dependsOn logic. We have various scenarios where the check does not fit any of the provided dependsOnX methods available. Instead of adding all these variations, it would be great if I can specify a callback and then handle the specific logic.

I would expect the callback to receive the value of the dependsOn field, and you can expect the callback to return true/false.

Something like

->dependsOnCallback('my_field',function($value) {
//add business logic

return true; //if I want it to show
return false; //if I do not want it to show

}
jmverges commented 1 year ago

+1 here

beiaduo commented 1 year ago

+1

myounis97 commented 10 months ago

+1