CheckboxList: modifyOptionsQueryUsing does not exist
The docs say there should be this method to modify the options but this method does not exist:
https://filamentphp.com/docs/3.x/forms/fields/checkbox-list#customizing-the-relationship-query
I currently need to accomplish exactly that: Set the relationship based on a different table than the options.
Example code:
This code is inside a GroupRelationManager of a Template. A
Group
can belong to templatePermissions (which is the name of the relationship of the group) - but the options are coming from another table. Using the CheckboxList like this gives a wrong result. Also the modifyQueryUsing
-method is not called as long as options
is set. If I comment out ->options(...)
the modifyQueryUsing
is called.3 Replies
Does anyone has an idea? This seems like a bug, because it behaves differently than other components - also the missing method from the docs seems odd.
Options and relationship don’t work together. One will always override the other.
So I need to use either one and in my use case I think I need options and I should handle the relationship attach/detach myself in the action handle method?