© 2026 Hedgehog Software, LLC

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

Default sort direction on table groups

Is there a way to define the default sort direction on table groups?
// Exemple where it makes more sense to sort by descending order by default
Tables\Grouping\Group::make('priority')
    ->orderQueryUsing(function (Builder $query, string $direction) {
        $query->orderByRaw('FIELD(priority, "low", "medium", "high") ' . $direction);
    })
// Exemple where it makes more sense to sort by descending order by default
Tables\Grouping\Group::make('priority')
    ->orderQueryUsing(function (Builder $query, string $direction) {
        $query->orderByRaw('FIELD(priority, "low", "medium", "high") ' . $direction);
    })
 

Also, is it possible to disable the ordering for some groups?
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

Table groups change default sort
FilamentFFilament / ❓┊help
3y ago
Default sort direction based on defaultgroup in table builder
FilamentFFilament / ❓┊help
3y ago
Collapse table groups by default
FilamentFFilament / ❓┊help
2y ago
Change column sort direction to descending by default
FilamentFFilament / ❓┊help
3y ago