PHPackages                             ankane/hightop - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. ankane/hightop

ActiveLibrary[Database &amp; ORM](/categories/database)

ankane/hightop
==============

A nice shortcut for group count queries with Eloquent / Laravel

v0.2.0(2y ago)55MITPHPPHP &gt;= 8.1CI passing

Since Aug 23Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/ankane/hightop-php)[ Packagist](https://packagist.org/packages/ankane/hightop)[ RSS](/packages/ankane-hightop/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (3)Used By (0)

Hightop PHP
===========

[](#hightop-php)

A nice shortcut for group count queries with Eloquent / Laravel

```
Visit::top('browser');
// [
//   'Chrome' => 63,
//   'Safari' => 50,
//   'Firefox' => 34
// ]
```

[![Build Status](https://github.com/ankane/hightop-php/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/hightop-php/actions)

Installation
------------

[](#installation)

Run:

```
composer require ankane/hightop
```

Options
-------

[](#options)

Limit the results

```
Visit::top('referring_domain', 10);
```

Include null values

```
Visit::top('search_keyword', null: true);
```

Works with expressions

```
use Illuminate\Database\Query\Expression;

Visit::top(new Expression('lower(referring_domain)'));
```

And distinct

```
Visit::top('city', distinct: 'user_id');
```

And min count

```
Visit::top('city', min: 10);
```

And `where` clauses

```
Visit::where('browser', 'Firefox')->top('os');
```

History
-------

[](#history)

View the [changelog](CHANGELOG.md)

Contributing
------------

[](#contributing)

Everyone is encouraged to help improve this project. Here are a few ways you can help:

- [Report bugs](https://github.com/ankane/hightop-php/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/hightop-php/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features

To get started with development:

```
git clone https://github.com/ankane/hightop-php.git
cd hightop-php
composer install
composer test
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance47

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~677 days

Total

2

Last Release

732d ago

PHP version history (2 changes)v0.1.0PHP &gt;= 8.0

v0.2.0PHP &gt;= 8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/220358?v=4)[Andrew Kane](/maintainers/ankane)[@ankane](https://github.com/ankane)

---

Top Contributors

[![ankane](https://avatars.githubusercontent.com/u/220358?v=4)](https://github.com/ankane "ankane (17 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ankane-hightop/health.svg)

```
[![Health](https://phpackages.com/badges/ankane-hightop/health.svg)](https://phpackages.com/packages/ankane-hightop)
```

###  Alternatives

[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M626](/packages/spatie-laravel-medialibrary)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M94](/packages/mongodb-laravel-mongodb)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k32.6M46](/packages/kirschbaum-development-eloquent-power-joins)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[awobaz/compoships

Laravel relationships with support for composite/multiple keys

1.2k11.7M46](/packages/awobaz-compoships)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
