$items = DataRelationship::where('link_id', $link->id)->get()->filter(function($user) {
return (isset($user->user));
})->sortByDesc(function($item) {
return $item->club->where('status', 1)->count();
})->take(10)
DataRelationship::select(['id', 'name', etc...])->whereLinkId($link->id)->whereHas('user')
->addSelect(
DB::raw( '(select count(id) from clubs where data_relationships.id = clubs.data_relationship_id) as clubs_count' )
)->orderBy('clubs_count', 'desc')->get();