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

ActiveLibrary

thomasjohnkane/slow-query-notifier
==================================

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

v1.0.0(6y ago)941127[5 PRs](https://github.com/thomasjohnkane/slow-query-notifier/pulls)MITPHPPHP ^7.3

Since Feb 17Pushed 3y ago1 watchersCompare

[ Source](https://github.com/thomasjohnkane/slow-query-notifier)[ Packagist](https://packagist.org/packages/thomasjohnkane/slow-query-notifier)[ Docs](https://github.com/thomasjohnkane/slow-query-notifier)[ RSS](/packages/thomasjohnkane-slow-query-notifier/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (6)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 thomasjohnkane/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

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

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

Unknown

Total

1

Last Release

2274d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

database-query-monitoringlaravelperformance-monitoringthomasjohnkaneslow-query-notifier

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[bref/laravel-bridge

An advanced Laravel integration for Bref, including Octane support.

3384.1M11](/packages/bref-laravel-bridge)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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