PHPackages                             sararzbn/queryspy - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. sararzbn/queryspy

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

sararzbn/queryspy
=================

Laravel profiler for slow queries with smart suggestions

v1.1.2(1y ago)16MITPHP

Since Jun 21Pushed 1y agoCompare

[ Source](https://github.com/sararzbn/queryspy)[ Packagist](https://packagist.org/packages/sararzbn/queryspy)[ RSS](/packages/sararzbn-queryspy/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (6)Used By (0)

🕵️ QuerySpy – Laravel Slow Query Profiler
=========================================

[](#️-queryspy--laravel-slow-query-profiler)

**QuerySpy** is a developer-friendly profiler for Laravel that captures slow SQL queries and suggests optimizations.

🚀 Features
----------

[](#-features)

- Logs all slow database queries
- Clean dashboard with filters and search
- Smart suggestions (e.g. avoid SELECT \*, use WHERE, add LIMIT)
- CLI commands to export or clear query logs
- Works out of the box with zero config
- 100% test coverage

📦 Installation
--------------

[](#-installation)

To install the package, simply run the following Composer command:

```
composer require sararzbn/queryspy

```

⚙️ Configuration (optional)
---------------------------

[](#️-configuration-optional)

```
php artisan vendor:publish --tag=queryspy-config

```

(Only needed if config publishing is supported)

🗄️ Database Migration
---------------------

[](#️-database-migration)

QuerySpy stores slow queries in a dedicated database table. To create it, run:

```
php artisan migrate

```

🖥️ Usage
--------

[](#️-usage)

### Dashboard

[](#dashboard)

Open in browser:

```
http://localhost:8000/queryspy

```

### Trigger a slow query manually (for testing)

[](#trigger-a-slow-query-manually-for-testing)

```
\DB::table('users')->whereRaw('pg_sleep(1)')->get();

```

> `pg_sleep(1)` causes a delay on PostgreSQL.

🛠️ CLI Commands
---------------

[](#️-cli-commands)

Export queries:

```
php artisan queryspy:export --format=csv
php artisan queryspy:export --format=json

```

Clear the log file:

```
php artisan queryspy:clear

```

🧩 Roadmap
---------

[](#-roadmap)

- Live dashboard updates (AJAX polling)
- Tag queries with request/user context
- JOIN performance analyzer

👩‍💻 Author
----------

[](#‍-author)

Created with ❤️ by [Sara Rouzbahani](https://github.com/sararzbn)

📄 License
---------

[](#-license)

MIT License

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance49

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

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

Every ~0 days

Total

5

Last Release

378d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a8c1df385b899552a31736c218655cabf4693387d200e0dd9bc765571594efd?d=identicon)[root\_rzbn](/maintainers/root_rzbn)

---

Top Contributors

[![srouzbahani](https://avatars.githubusercontent.com/u/165389961?v=4)](https://github.com/srouzbahani "srouzbahani (24 commits)")

### Embed Badge

![Health badge](/badges/sararzbn-queryspy/health.svg)

```
[![Health](https://phpackages.com/badges/sararzbn-queryspy/health.svg)](https://phpackages.com/packages/sararzbn-queryspy)
```

###  Alternatives

[fjogeleit/prometheus-messenger-middleware

Prometheus Middleware for the Symfony Messenger Component

2255.2k](/packages/fjogeleit-prometheus-messenger-middleware)[spatie/craft-ray

Easily debug CraftCMS projects

1638.6k](/packages/spatie-craft-ray)

PHPackages © 2026

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