If you want to have your database (rather than PHP) sort the results, you have to use joins. Something like this:
$users = User::with('purchases')
->selectRaw('users.*, count(purchases.user_id) as aggregate')
->leftJoin('purchases', 'purchases.user_id', '=', 'users.id')
->groupBy('purchases.user_id')
->having('aggregate', '>', 10)
->orderBy('aggregate', 'desc')
->get();
It looks a bit messy so you can extract out into a query scope and do something like this:
$users = User::with('purchases')->orderByHas('purchases', '>', 10, 'DESC')->get();
And add this to your base model (or just User model):
public function scopeOrderByHas($query, $relation, $operator = '>=', $count = 1, $dir = 'DESC') {
$table = $this->getTable();
$relation = $this->$relation();
$relatedTable = $relation->getRelated()->getTable();
$primaryKey = $this->primaryKey;
$foreignKey = $relation->getForeignKey();
return $query->selectRaw("{$table}.*, count({$foreignKey}) as aggregate")
->leftJoin($relatedTable, $foreignKey, '=', "{$table}.{$primaryKey}")
->groupBy($foreignKey)
->having('aggregate', $operator, $count)
->orderBy('aggregate', $dir);
}