© 2026 Hedgehog Software, LLC

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

SQL error on table bulk action when originally sorting by relationship count

Hello, when using sorting by relationship count:

Tables\Columns\TextColumn::make('people_count')->counts('people')->label('People')->sortable(),

and then executing a table BulkAction, the SQL that Filament executes to get the records to work with is the following (example of me selecting 3 companies from the table):

select * from
companies
companies
where
companies
companies
.
id
id
in (53, 80, 1, 12) order by
people_count
people_count
desc

This query is not valid, as there is not column "people_count".
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 column loses data when sorting by relationship
FilamentFFilament / ❓┊help
3y ago
Table Bulk Action
FilamentFFilament / ❓┊help
3y ago
relationship sorting in table
FilamentFFilament / ❓┊help
3y ago
Custom table relationship count
FilamentFFilament / ❓┊help
3y ago