How to Order Infolist RepeatableEntry by Custom Column Instead of ID?

Dear all, I'm aware that Forms and Infolists use different schemas in Filament, and i've successfully used the ->orderColumn('order_field') method on a Form Repeater to set a custom order, and it works perfectly. However, in the Infolist RepeatableEntry, the items always appear ordered by ID (ascending), and I can't find any documentation on how to change this. There doesn't seem to be a method like ->orderColumn() for Infolists. Is there a way to display RepeatableEntry items in a custom order in the Infolist? Attached both infolist and form repeater screenshot for comparison. Thank you.
No description
No description
Solution:
I think you can just call ->state method and grab data you want to. ```php RepeatableEntry::make('items') ->label('Items') ->hiddenLabel()...
Jump to solution
3 Replies
Trauma Zombie
Trauma Zombie3w ago
@Winter Is Coming Did you find a solution for this?
Solution
Trauma Zombie
Trauma Zombie3w ago
I think you can just call ->state method and grab data you want to.
RepeatableEntry::make('items')
->label('Items')
->hiddenLabel()
->state(function (Model $record): Collection {
return $record->items->sortBy('position');
})
RepeatableEntry::make('items')
->label('Items')
->hiddenLabel()
->state(function (Model $record): Collection {
return $record->items->sortBy('position');
})
Winter Is Coming
Winter Is ComingOP3w ago
thanks. will check on that

Did you find this page helpful?