Grouping by parent in a Select component
I have a 3 models -
And each CustomOptionType belongs to CustomOption -
Now, in
Thanks in advance.
Brief, CustomOption and CustomOptionType. Each Brief belongs to many CustomOptionType with a pivot table - And each CustomOptionType belongs to CustomOption -
Now, in
BriefResource.php - I'd like to group this Select component by the 'parents' of the custom option types -
`php
Select::make('Custom Options')
->label('Custom Options')
->preload()
->searchable()
->relationship('customOptionTypes', 'name')
->multiple(),
```
I know you can group them when explicitly using the ->options()` function, but in this case im loading those directly via a relationship so im not sure how to achieve that. Thanks in advance.