© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Eric

How to apply sortable by default on tables

in my users resource, by default i modify the query like so:
User::query()->latest()
User::query()->latest()

i do it to sort it by default, by more recents created first.

but now i added the created_at field to the user resource table, so the user choose the sorting there.

but as i am manually applying the sorting, now the user cant sort be date since always applies the
latest()
latest()


so the question is, how to correctly apply the initial sorting but then let the user change it?
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

Minor - Switch `sortable()` default behaviour on tables?
FilamentFFilament / ❓┊help
2y ago
Sortable by morph-relation
FilamentFFilament / ❓┊help
3y ago
Pagination default value on tables
FilamentFFilament / ❓┊help
3y ago
how apply sort desc in all tables
FilamentFFilament / ❓┊help
3y ago