© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
13 replies
corean

relationship sorting in table

Tables\Columns\TextColumn::make('firstCategory.name')
->sortable(query: fn ($query, $direction) => 
  $query->with('firstCategory')
  ->orderBy('firstCategory.order_column', $direction)
),
Tables\Columns\TextColumn::make('firstCategory.name')
->sortable(query: fn ($query, $direction) => 
  $query->with('firstCategory')
  ->orderBy('firstCategory.order_column', $direction)
),

`SQLSTATE[42S22]: Column not found: 1054 Unknown column 'firstCategory.order_column' in 'order clause'`
`SQLSTATE[42S22]: Column not found: 1054 Unknown column 'firstCategory.order_column' in 'order clause'`
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 optional relationship and sorting
FilamentFFilament / ❓┊help
3y ago
Issue with Sorting a Summed Relationship Column in Filament Table
FilamentFFilament / ❓┊help
12mo ago
Table column loses data when sorting by relationship
FilamentFFilament / ❓┊help
3y ago
Filtering of relationship in table
FilamentFFilament / ❓┊help
13mo ago