Distinct Table Count
Adding distinct() makes it to the count query, but the column does not. Is there a different way?
TextColumn::make('responses_count')->counts([
'responses' => fn ($query) => $query->distinct('request_id')
])
->label('Responses')
SELECT DISTINCT count(*) FROM
responses
WHERE churches
.id
= responses
.church_id
and responses
.TYPE
= 1) AS responses_count
FROM churches
2 Replies