Issue with Sorting a Summed Relationship Column in Filament Table
I have a Filament table displaying a list of my “Projects.” One of the columns calculates the sum of the “converted_net” values from the related “payments” table. This works correctly, and for projects without payments (i.e., nothing to sum), the column displays 0.
However, sorting this column does not work as expected. When sorting in descending order, projects with no payments (null values) appear at the top instead of those with the highest payment sums.
How can I fix this?
1 Reply
I have this code now that works: