widget query filter on related field
I followed the instructions and have a summarizing widget table for Campaign Status.
It has filters on the Dashboard: Client and Service Manager.
It filters fine on client_id, a field in the campaign table.
Dashboard:
The other filter returns the correct id to the widget because I can log the values in the widget.
But I don't understand how to filter by related data.
Campaign BelongsTo a Client, a Client BelongsTo a Customer Support Manager
Here is my Widget table
Error:
It has filters on the Dashboard: Client and Service Manager.
It filters fine on client_id, a field in the campaign table.
Dashboard:
The other filter returns the correct id to the widget because I can log the values in the widget.
But I don't understand how to filter by related data.
Campaign BelongsTo a Client, a Client BelongsTo a Customer Support Manager
Here is my Widget table
Error:

Solution
Yeah,
I guess you need some left join
customSupportManager() is very likely not a column in your DB. You can't use Laravel relation on a DB directly.$query->where('customerSupportManager()', $csm_id); // belongsToThroughI guess you need some left join
leftJoin() to get the needed columns