© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Husky110

Sortable by morph-relation

Hi folks,
I'm trying to make a column sortable, which is beeing referenced by a morph-relation.
I tried using
->sortable(query: fn($query, $direction) => $query->orderBy('relationame.relationproperty', $direction))
->sortable(query: fn($query, $direction) => $query->orderBy('relationame.relationproperty', $direction))
and made sure that all possible morphs got said relationproperty, but to no avail. Laravel tells me
Unknown column 'relationname.relationproperty' in 'order clause'
Unknown column 'relationname.relationproperty' in 'order clause'
and the SQL only seems to use the basemodel and not the relationmodel. Am I missing something here?
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

Sortable relation...
FilamentFFilament / ❓┊help
2y ago
RelationManager with relation having a morph
FilamentFFilament / ❓┊help
13mo ago
Sortable - Sort by far relationship
FilamentFFilament / ❓┊help
3y ago
Pivot-Table with Morph-Relation?
FilamentFFilament / ❓┊help
12mo ago