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
DanielvdSpoelOP16mo ago
it's not being sorted on day of week, also not on id/alphabeticly bumb
LeandroFerreira
LeandroFerreira16mo ago
not sure about v2 but on v3 it is working
DanielvdSpoel
DanielvdSpoelOP16mo ago
yeah but becouse of one plugin we can't update
toeknee
toeknee16mo 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
DanielvdSpoelOP16mo ago
ahhh shit 😂

Did you find this page helpful?