Relationship manager with `distinct()` in query displaying duplicate rows
I have a database pivot table between two models (Client, Carrier). The pivot table contains another nullable foreign key to a Route model.
This relation manager is on my
My relationship is defined as:
When called outside of filament this relationship is working and 2 rows are returned (desired outcome). When filament uses this relationship in the relation manager it adds more to the select in the form of pivot ids and the query returns 3 rows (the distinct() no longer applies?).
Thanks!
This relation manager is on my
ClientResource, and should display unique Carrier records based on this pivot table.My relationship is defined as:
When called outside of filament this relationship is working and 2 rows are returned (desired outcome). When filament uses this relationship in the relation manager it adds more to the select in the form of pivot ids and the query returns 3 rows (the distinct() no longer applies?).
Thanks!

Solution
I've added the following to my table and it seems to be returning better results.