PHPackages                             cbdt/query-diet - 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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. cbdt/query-diet

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

cbdt/query-diet
===============

Query monitoring and discreet display of query count and execution time.

v1.0.1(2y ago)19[2 PRs](https://github.com/cbdt/query-diet/pulls)MITPHPPHP ^8.0

Since Jun 13Pushed 2y ago1 watchersCompare

[ Source](https://github.com/cbdt/query-diet)[ Packagist](https://packagist.org/packages/cbdt/query-diet)[ Docs](https://github.com/cbdt/query-diet)[ RSS](/packages/cbdt-query-diet/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (12)Versions (5)Used By (0)

Query Diet: Explore queries that have a bad diet
================================================

[](#query-diet-explore-queries-that-have-a-bad-diet)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9ccdb3cc835b456cb923efbaf2473ff16f19f502fdc9b6c26adc1f373ddf31cb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636264742f71756572792d646965742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cbdt/query-diet)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/cc7d476e88aedc9cec84cb1f47650f0a7df6b121dbb93504be95edef5d73f278/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636264742f71756572792d646965742f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/cbdt/query-diet/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/e7ad07cb84b179189249b0a296cdd86195215584c0e0d32079cf584dc795eb76/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636264742f71756572792d646965742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cbdt/query-diet)

Query monitoring and discreet display of query count and execution time in the Laravel app.

This is a Query Diet having a good diet (6 queries, 0.5ms):

[![How it looks when there is a bad query diet](/example_good_diet.png)](/example_good_diet.png)

This is a Query Diet having a bad diet (28 queries, 79ms):

[![How it looks when there is a bad query diet](/example_bad_diet.png)](/example_bad_diet.png)

This project is a port of the Ruby gem [query\_diet](https://github.com/makandra/query_diet) to Laravel.

Support us
----------

[](#support-us)

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

[](#installation)

You can install the package via composer:

```
composer require cbdt/query-diet
```

You can publish the config file with:

```
php artisan vendor:publish --tag="query-diet-config"
```

This is the contents of the published config file:

```
return [
    'enabled' => env('QUERY_DIET_ENABLED', true),
    'bad_query_time_ms' => env('QUERY_DIET_BAD_QUERY_TIME_MS', 100),
    'bad_query_count' => env('QUERY_DIET_BAD_QUERY_COUNT', 10),
];
```

Usage
-----

[](#usage)

You'll see on the top right of your screen a small badge with the number of queries executed during the request.

Credits
-------

[](#credits)

- [Clément Baudet](https://github.com/cbdt)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 71.4% 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 ~9 days

Total

2

Last Release

1058d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cc641df42fcb4e376a2987acce09adc76b0df4f10e4756c7e169a36c1af75749?d=identicon)[clementbaudet](/maintainers/clementbaudet)

---

Top Contributors

[![cbdt](https://avatars.githubusercontent.com/u/10958405?v=4)](https://github.com/cbdt "cbdt (10 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laravelcbdtquery-diet

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/cbdt-query-diet/health.svg)

```
[![Health](https://phpackages.com/badges/cbdt-query-diet/health.svg)](https://phpackages.com/packages/cbdt-query-diet)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-slack-alerts

Send a message to Slack

3212.6M4](/packages/spatie-laravel-slack-alerts)[keepsuit/laravel-opentelemetry

OpenTelemetry integration for laravel

142347.8k](/packages/keepsuit-laravel-opentelemetry)[spatie/laravel-error-share

Share your Laravel errors to Flare

43965.6k3](/packages/spatie-laravel-error-share)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[tapp/filament-maillog

Filament plugin to view outgoing mail

2952.6k1](/packages/tapp-filament-maillog)

PHPackages © 2026

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