FilamentF
Filamentβ€’2y ago
zemo

Order TextColumn relationship results by desc

this might be an easy thing but I can't find a way to do it πŸ˜…
as shown in the screenshot, I have a TextColumn that loads results from a relationship. So there might be multiple years. I would like to order them by desc, so that the latest year appears as first. How do I do that?

Tables\Columns\TextColumn::make('subscriptions.subscriptionYear.year')
    ->label('Iscrizioni')
    ->searchable()
    ->listWithLineBreaks()
    ->limitList(1)
    ->expandableLimitedList(),
sortbydesc.png
Was this page helpful?