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. ankane/hightop

ActiveLibrary

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

A nice shortcut for group count queries with Eloquent / Laravel

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

Since Aug 23Pushed 4mo ago1 watchersCompare

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

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

32

—

LowBetter than 72% of packages

Maintenance57

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

678d ago

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

v0.2.0PHP &gt;= 8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c9a2a71909cc025e622de0bd0d6d01f07078040d27274173a15681f11d81943?d=identicon)[ankane](/maintainers/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

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)

PHPackages © 2026

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