A nice shortcut for group count queries with Eloquent / Laravel

Overview

Hightop PHP

A nice shortcut for group count queries with Eloquent / Laravel

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

Build Status

Installation

Run:

composer require ankane/hightop

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

View the changelog

Contributing

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

To get started with development:

git clone https://github.com/ankane/hightop-php.git
cd hightop-php
composer install
composer test
You might also like...
Auto-expiring tags with additional payload data on any eloquent model.

Laravel TempTag Auto-expiring tags with additional payload data on any eloquent model. Installation first you need to install and configure mongodb in

Personal PHP MySQL query handler based on Eloquent using PDO.

🐳 Equivoluent Welcome to "Equivoluent" my personal PHP MySQL query handler using PDO. Equivoluent is based on Laravel's Eloquent. The goal of "Equivo

Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Give our package a Star to support us ⭐ 😍 Inst

A Simple Linode SDK built for Laravel with @JustSteveKing laravel-transporter package

linode client A Simple Linode client built for Laravel with @JustSteveKing laravel-transporter package Installation You can install the package via co

A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.
A Laravel Wrapper for the Binance API. Now easily connect and consume the Binance Public & Private API in your Laravel apps without any hassle.

This package provides a Laravel Wrapper for the Binance API and allows you to easily communicate with it. Important Note This package is in early deve

Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3+ that enables you to manage RSS feeds for your favorite podcasts and listen to the episodes in a seamless UI.
Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3+ that enables you to manage RSS feeds for your favorite podcasts and listen to the episodes in a seamless UI.

laravelpodcast | A Laravel podcast manager package - v0.0.8 Introduction Laravel Podcast Manager is a complete podcast manager package for Laravel 5.3

Laravel-htaccess - a package for dynamically edit .htaccess in laravel

laravel-htaccess a package for dynamically edit .htaccess in laravel use RedirectHtaccess Facade function for add RedirectHtaccess()-add(); return in

Laravel & Google Drive Storage - Demo project with Laravel 6.x and earlier

Laravel & Google Drive Storage Demo project with Laravel 8.X Look at the commit history to see each of the steps I have taken to set this up. Set up t

Empower your business to accept payments globally, earn rewards and invest in crypto with lazerpay laravel sdk in your laravel project.
Empower your business to accept payments globally, earn rewards and invest in crypto with lazerpay laravel sdk in your laravel project.

Lazerpay Laravel Package pipedev/lazerpay is a laravel sdk package that access to laravel api Installation PHP 5.4+ and Composer are required. To get

Owner
Andrew Kane
Andrew Kane
Easily build Eloquent queries from API requests

Build Eloquent queries from API requests This package allows you to filter, sort and include eloquent relations based on a request. The QueryBuilder u

Spatie 3.5k Jan 7, 2023
A Nice LevelSystem plugin for Pocketmine

LevelSystem A Nice LevelSystem plugin for Pocketmine Commands Command Description Permission /ls LevelSystem Command ls.cmd.staff Features Support Pur

Laith Youtuber 9 Sep 12, 2022
Simple, modern looking server status page with administration and some nice features, that can run even on shared webhosting

Simple, modern looking server status page with administration and some nice features, that can run even on shared webhosting

Server status project 363 Dec 28, 2022
Group of projects completed by me as a part of Intern at LGM

LGMVIP-Projects Group of projects completed by me as a part of Intern at LGM Author Details: Name : MAINAK CHAUDHURI Position : Web Developer Intern,

MAINAK CHAUDHURI 25 Dec 17, 2022
Music website developed as a final group project for our Webpage Development class.

double-drummer Music listening website developed as final group project for our Webpage Development course. All parts that disclosed any information r

darwin 1 Dec 8, 2021
Rah privileges - Configure Textpattern CMS' user-group privileges through Preferences panel

rah_privileges Packagist | Donate Configure admin-side user-group permissions from Textpattern CMS’ preferences panel. Install Using Composer: $ compo

Jukka Svahn 4 Apr 16, 2022
A complete solution for group projects in organizations that lets you track your work in any scenario. Working in a team is a cumbersome task, ease it using our project management system.

SE-Project-Group24 What is Evolo? Evolo is Dashboard based Project Management System. A complete solution for group projects in organizations that let

Devanshi Savla 2 Oct 7, 2022
🔍 Generates database queries based on one unique string

?? Laravel Search String Generates database queries based on one unique string using a simple and customizable syntax. Introduction Laravel Search Str

Loris Leiva 735 Dec 30, 2022
#️⃣ Generate, Save, and Route Stripe-like Hash IDs for Laravel Eloquent Models

Using this package you can generate, save and, route Stripe-like Hash Ids for your Eloquent Models. Hash Ids are short, unique, and non-sequential, an

Yunus Emre Deligöz 88 Dec 27, 2022
Ratings and reviews for the Laravel's Eloquent models ⭐⭐⭐⭐⭐

Laravel Reviews Ratings and reviews for the Laravel's Eloquent models Users will be able to rate and review the reviewable models. Then these reviews

Mohamed Ali Tavasoli 31 Dec 4, 2022