© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
noahlocke

Is it possible to sort options in a Select form field?

I have a
Select
Select
field pulling in options from a relationship. Trouble is, they are sorted alphabetically, but I have a custom sort order on the model using a
sort_order
sort_order
column. I don't see anything in the docs that indicates that this is possible, but figured I'd ask before I venture down the road of a custom field (would rather not).

Here's my code example:

Select::make('noteServices')
->multiple()
->preload()
->relationship(
    name: 'services',
    titleAttribute: 'name'
),
Select::make('noteServices')
->multiple()
->preload()
->relationship(
    name: 'services',
    titleAttribute: 'name'
),
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Is it possible to load select options asynchronous?
FilamentFFilament / ❓┊help
3y ago
Is it possible to test a multiple select form?
FilamentFFilament / ❓┊help
3y ago
Is it possible to sort a table by a relation field...? 🤔
FilamentFFilament / ❓┊help
3y ago
Select Form Field Limits 50 Options Visible
FilamentFFilament / ❓┊help
3y ago