raptor
raptor
FFilament
Created by raptor on 4/18/2024 in #❓┊help
Table: Multiple counting on same relationship
How can I have multiple counts on the same relation in one table?
TextColumn::make('applications_count')->counts('applications')->label('Applications'),

TextColumn::make('applications_count')->counts([
'applications' => fn (Builder $query) => $query->where('completed', 1),
])->label('Completed applications'),
TextColumn::make('applications_count')->counts('applications')->label('Applications'),

TextColumn::make('applications_count')->counts([
'applications' => fn (Builder $query) => $query->where('completed', 1),
])->label('Completed applications'),
This just shows the last column "Completed applications", but the name has to be applications_count for the relation to work.
7 replies