PHPackages                             ilzrv/laravel-slow-query-detector - 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. ilzrv/laravel-slow-query-detector

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

ilzrv/laravel-slow-query-detector
=================================

Laravel Slow DB Query Detector

v2.1.0(3y ago)611.3k↓50%8[1 issues](https://github.com/ilzrv/laravel-slow-query-detector/issues)MITPHPPHP ^8.0CI failing

Since Apr 12Pushed 3y ago2 watchersCompare

[ Source](https://github.com/ilzrv/laravel-slow-query-detector)[ Packagist](https://packagist.org/packages/ilzrv/laravel-slow-query-detector)[ RSS](/packages/ilzrv-laravel-slow-query-detector/feed)WikiDiscussions 2.x Synced 3d ago

READMEChangelog (5)Dependencies (4)Versions (9)Used By (0)

Laravel Slow Query Detector
===========================

[](#laravel-slow-query-detector)

[![Latest Version on Packagist](https://camo.githubusercontent.com/08136919b77a6a561fd724c6a5bd18e0196329ebbf313d5e0e99217edb598938/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c7a72762f6c61726176656c2d736c6f772d71756572792d6465746563746f72)](https://packagist.org/packages/ilzrv/laravel-slow-query-detector)[![Software License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)[![Build Status](https://camo.githubusercontent.com/665577b516b21f431784ee48b96d9a64b5db76b8683bea145204620b107f936e/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f696c7a72762f6c61726176656c2d736c6f772d71756572792d6465746563746f72)](https://travis-ci.org/ilzrv/laravel-slow-query-detector)[![Total Downloads](https://camo.githubusercontent.com/9749a305c26e5b75b4082cf2c028c0e5817fc678c39377e1f6cd28e391c9b53a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c7a72762f6c61726176656c2d736c6f772d71756572792d6465746563746f72)](https://packagist.org/packages/ilzrv/laravel-slow-query-detector)

This package allows you to detect controller methods in the code that make a lot of queries to the database as well as find very heavy queries.

Requirements
------------

[](#requirements)

- PHP 8.0+
- Laravel 9+

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

[](#installation)

You can install the package via composer:

```
composer require ilzrv/laravel-slow-query-detector
```

Configuration
-------------

[](#configuration)

By default, the package is already configured and enabled, but you can change the settings if necessary. To publish the configuration file, run:

```
php artisan vendor:publish --provider="Ilzrv\LaravelSlowQueryDetector\ServiceProvider"
```

### `SQD_ENABLED`

[](#sqd_enabled)

Determines whether query listening is enabled.

### `SQD_CODE_MAX_QUERIES`

[](#sqd_code_max_queries)

Maximum number of queries when processing the controller method. If your method executes more queries than this value the notification will be received.

### `SQD_CODE_MAX_TIME`

[](#sqd_code_max_time)

Maximum execution time of the controller method (in ms). If your method takes longer than this value to complete the notification will be received.

### `SQD_QUERY_BINDINGS`

[](#sqd_query_bindings)

Queries with bindings. If true then bindings will be applied to queries in notification. Example (if true): `select * from users where name = John` instead of `select * from users where name = ?`

### `SQD_QUERY_MAX_TIME`

[](#sqd_query_max_time)

Maximum execution time for each query in DB (in ms). If at least one query exceeds this value you will receive a notification.

Example logs output:
--------------------

[](#example-logs-output)

```
[2020-04-12 06:59:21] production.CRITICAL: Array
(
    [SQD] => Array
        (
            [Execution Time] => 60 ms.
            [Queries Count] => 2
            [Heavy Queries Count] => 2
            [Full URL] => https://example.org/?name=John
            [Action] => App\Http\Controllers\HomeController@index
            [Heaviest Query] => Array
                (
                    [Query] => select * from `users` where `name` = John
                    [Time] => 50.67 ms.
                )

        )
)
```

### License

[](#license)

The Laravel Slow Query Detector is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 98.1% 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 ~191 days

Recently: every ~213 days

Total

7

Last Release

1127d ago

Major Versions

v1.0.0-beta.2 → v2.0.02022-06-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d687963029adc07b2be221dd2fa5e08c0decbfc5f0720f0c49b5a7445513ccc?d=identicon)[ilzrv](/maintainers/ilzrv)

---

Top Contributors

[![ilzrv](https://avatars.githubusercontent.com/u/28765966?v=4)](https://github.com/ilzrv "ilzrv (52 commits)")[![riskihajar](https://avatars.githubusercontent.com/u/6370157?v=4)](https://github.com/riskihajar "riskihajar (1 commits)")

---

Tags

database-query-monitoringlaravellaravel-slow-code-detectorlaravel-slow-query-detectorlaravel-sqdperformance-monitoring

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ilzrv-laravel-slow-query-detector/health.svg)

```
[![Health](https://phpackages.com/badges/ilzrv-laravel-slow-query-detector/health.svg)](https://phpackages.com/packages/ilzrv-laravel-slow-query-detector)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k54.9M11.7k](/packages/illuminate-database)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[lemaur/eloquent-publishing

218.1k1](/packages/lemaur-eloquent-publishing)[laravel-liberu/laravel-gedcom

A package that converts gedcom files to Eloquent models

782.5k1](/packages/laravel-liberu-laravel-gedcom)

PHPackages © 2026

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