Checkbox list from relation only orders by title? Solved just use modifyQueryUsing

We need to order a checkbox list by ID so that the option "Other" always comes last as it is when ordered by id. I'm going to create an override of the CheckboxList class relationship function but wondering if others have this issue and maybe it would be nice to have an orderBy option for the list
Solution:
Oh it's simple, I love FIlament 🙂 ❤️
->relationship('conditions', 'name', modifyQueryUsing: fn (Builder $query) => $query->orderBy('id'))
->relationship('conditions', 'name', modifyQueryUsing: fn (Builder $query) => $query->orderBy('id'))
...
Jump to solution
1 Reply
Solution
acroninja
acroninja7mo ago
Oh it's simple, I love FIlament 🙂 ❤️
->relationship('conditions', 'name', modifyQueryUsing: fn (Builder $query) => $query->orderBy('id'))
->relationship('conditions', 'name', modifyQueryUsing: fn (Builder $query) => $query->orderBy('id'))
Want results from more Discord servers?
Add your server