Count Columns (beta)

Count columns provide an easy way to display the "Count" of a relation.

1CountColumn::make('Related Users')
2 ->setDataSource('users')
3 ->sortable(),

The "sortable()" callback can accept a callback, or you can use the default behaviour, which calculates the correct field to sort on.

Please also see the following for other available methods: