© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
jop00

Custom table relationship count

Hello, I need to filter the realtionship count of a column.

Tables\Columns\TextColumn::make('comments_count')->counts(fn (Builder $query) => $query->withCount('comments')->where('status_id', 1))       ->sortable(),
Tables\Columns\TextColumn::make('comments_count')->counts(fn (Builder $query) => $query->withCount('comments')->where('status_id', 1))       ->sortable(),


What am I doing wrong?
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

How to show Count relationship in table?
FilamentFFilament / ❓┊help
3y ago
Table: Multiple counting on same relationship
FilamentFFilament / ❓┊help
2y ago
ManyToMany Relationship Attach Action on Custom Table
FilamentFFilament / ❓┊help
8mo ago
Distinct Table Count
FilamentFFilament / ❓┊help
2y ago