field relationship sort order

If I have a
Select
with a relationship, is there an easy way to sort the relation options by a custom order (i.e. in this example, categories would have a sort attribute)? Want to avoid adding scope or constructor to the model if possible.

Forms\Components\Select::make('category_id')
    ->relationship('category', 'category')
    ->required(),
Was this page helpful?