© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Ryuuuu

Sorting a table with a view as a column

So i have this filament table that doesn't have tradition columns, but instead has a view as a column like in the first pic. I managed to sort this by adding a sortBy to the end of my query builder in ->query(), modifying its parameters and running resetTable() to see the changes. The problem is that ->query() only takes a query builder, and i have a column thats calculated afterward that you can't find in the database, and i want to sort using this column. If i had access to the collection that results from the query builder, sortBy('column') would work, but since its not an actual column in the database, adding sortBy to the query builder gives an error.

tl;dr: anyone know how i can access/sort a table's actual collection of records and not just the query builder from query()?
image.png
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

Issue with Sorting a Summed Relationship Column in Filament Table
FilamentFFilament / ❓┊help
12mo ago
Noob question: Sorting a hasMany column in table
FilamentFFilament / ❓┊help
2y ago
Defaultsort / column sorting
FilamentFFilament / ❓┊help
3y ago
Table column loses data when sorting by relationship
FilamentFFilament / ❓┊help
3y ago