Displaying data from relationships
You may use “dot syntax” to access columns within relationships. The name of the relationship comes first, followed by a period, followed by the name of the column to display:Counting relationships
If you wish to count the number of related records in a column, you may use thecounts() method:
users is the name of the relationship to count from. The name of the column must be users_count, as this is the convention that Laravel uses for storing the result.
Determining relationship existence
If you simply wish to indicate whether related records exist in a column, you may use theexists() method:
users is the name of the relationship to check for existence. The name of the column must be users_exists, as this is the convention that Laravel uses for storing the result.
Aggregating relationships
Filament provides several methods for aggregating a relationship field, includingavg(), max(), min() and sum(). For instance, if you wish to show the average of a field on all related records in a column, you may use the avg() method:
users is the name of the relationship, while age is the field that is being averaged. The name of the column must be users_avg_age, as this is the convention that Laravel uses for storing the result.