PHPackages                             chapdel/slow-query-notifier - 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. chapdel/slow-query-notifier

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

chapdel/slow-query-notifier
===========================

Get notified if your Laravel app ever runs an objectively slow database call (configurable threshold)

11PHP

Since Oct 4Pushed 3y agoCompare

[ Source](https://github.com/chapdel/slow-query-notifier)[ Packagist](https://packagist.org/packages/chapdel/slow-query-notifier)[ RSS](/packages/chapdel-slow-query-notifier/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Slow Query Notifier for Laravel
===============================

[](#slow-query-notifier-for-laravel)

Get notified if your app ever runs a really slow database query. We set a default threshold, but you can configure it based on your needs &amp; expectations.

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

[](#installation)

You can install the package via composer:

```
composer require chapdel/slow-query-notifier
```

Usage
-----

[](#usage)

### Set an email address

[](#set-an-email-address)

```
// app/Providers/AppServiceProvider.php

use SlowQueryNotifier\SlowQueryNotifierFacade as SlowQueryNotifier;

public function boot()
{
    SlowQueryNotifier::toEmail('admin@example.com');
}
```

### Test it works (in Production)

[](#test-it-works-in-production)

If you are using this in production (as intendend) make sure it is working correctly:

```
php artisan sqn:test
```

This command will test two things:

- We can detect slow queries in your app
- We can send an email to you if a slow query runs

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

[](#configuration)

In general, we setup all of the configuration for you with sensible defaults. However, you can change the default settings if you'd like. To learn why we chose these defaults, [read the blog post](#).

### Threshold

[](#threshold)

The default is 99ms. Set a different `threshold` in milliseconds in your configuration:

```
SlowQueryNotifier::threshold(200)->toEmail('admin@example.com');
```

### Enable/Disable

[](#enabledisable)

The package is enabled by default. Set this value to `false` in your `.env` to bypass the listener.

```
SLOW_QUERY_NOTIFIER_ENABLED=false
```

Testing
-------

[](#testing)

```
phpunit
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Thomas Kane](https://github.com/thomasjohnkane)
- Thanks to Marcel Pociot for the original inspiration
- Thanks to Caleb Porzio for the guidance
- [All Contributors](../../contributors)

License
-------

[](#license)

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

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity24

Early-stage or recently created project

 Bus Factor1

Top contributor holds 84.6% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20987014?v=4)[Chapdel KAMGA](/maintainers/chapdel)[@chapdel](https://github.com/chapdel)

---

Top Contributors

[![thomasjohnkane](https://avatars.githubusercontent.com/u/8945177?v=4)](https://github.com/thomasjohnkane "thomasjohnkane (11 commits)")[![chapdel](https://avatars.githubusercontent.com/u/20987014?v=4)](https://github.com/chapdel "chapdel (2 commits)")

### Embed Badge

![Health badge](/badges/chapdel-slow-query-notifier/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M93](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M137](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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