Skip to content
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

BooleanGroup support #63

Open
inventionate opened this issue Jul 28, 2021 · 1 comment
Open

BooleanGroup support #63

inventionate opened this issue Jul 28, 2021 · 1 comment

Comments

@inventionate
Copy link

Thank you very much for the great package. At the moment I'm trying to use it with the BooleanGroup field, so that when a value is selected there, another field is displayed. Unfortunately, the BooleanGroup field requires an array cast for the source model attribute, so the current ->if() function cannot be used. I actually wanted to use `->if('booleangroup_field contains "MyValue":true') or something like that. Is there a way or an idea how I could implement this?

@inventionate
Copy link
Author

inventionate commented Jul 29, 2021

It's probably more like a hotfix, but when I change line 226 in ConditionalContainer.php to return Str::contains(json_encode($attributeValue), $conditionValue); BooleanGroup conditions work. I think a special is_array() check isn't needed and the json_encode() addition shouldn't break anything else. Whereas I'm pretty sure there are better solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant