$entities = \Auth::user()
->entities()
->with(['posts' => function ($query) {
$query->conditions();
}])
->groupBy('entities.id')
->get()
->toArray();
foreach ($entities as $entity) {
echo $entity['name'] . '-' . $entity['id'] . ' (+' . count($entity['posts']) . ')<br/>';
}