Is there a way to group options on a select when using a relationship?
It appears that using both
->options()
and ->relationship
doesn't really play well together.
I'm trying to create group options like seen here: https://filamentphp.com/docs/3.x/forms/fields/select#grouping-options
When I do this and try to select an option, I get the following error:
SQLSTATE[42S22]: [Microsoft][ODBC Driver 18 for SQL Server][SQL Server]Invalid column name 'collections'.When I instead use the relationship method, then the options method doesn't seem to work. My code:
1 Reply
Adding
->relationship('collections', 'name')->preload()
to the filter doesn't work. It wipes out the options and fills results from the relationship which is normally fine but I can't group options this way.