Checklist not sorted correctly

I have this code:
CheckboxList::make('days')
->label('Standaard beschikbaarheid')
->relationship('days', 'name', function (Builder $query) {
return $query->orderBy('day_of_week');
})
->getOptionLabelFromRecordUsing(fn (Model $record) => __('days.' . $record->name))
CheckboxList::make('days')
->label('Standaard beschikbaarheid')
->relationship('days', 'name', function (Builder $query) {
return $query->orderBy('day_of_week');
})
->getOptionLabelFromRecordUsing(fn (Model $record) => __('days.' . $record->name))
but it's not being sorted, does anyone know why?
6 Replies
DanielvdSpoel
DanielvdSpoelβ€’9mo ago
it's not being sorted on day of week, also not on id/alphabeticly bumb
LeandroFerreira
LeandroFerreiraβ€’9mo ago
not sure about v2 but on v3 it is working
DanielvdSpoel
DanielvdSpoelβ€’9mo ago
yeah but becouse of one plugin we can't update
toeknee
toekneeβ€’9mo ago
So there was a bug in V2 I believe seeing something about this, have a look through the PR's and see if there was a fix you can port back
DanielvdSpoel
DanielvdSpoelβ€’9mo ago
ahhh shit πŸ˜‚