PHPackages                             snype/nplusone - 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. snype/nplusone

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

snype/nplusone
==============

This package helps you detect and log N+1 queries in a Laravel application to help optimize database performance. By listening to all database queries executed during the request lifecycle, the package identifies queries that may lead to N+1 query problems, which can severely impact the performance of your application.

v4.0.0(1y ago)013MITPHPPHP ^7.0 || ^8.0

Since Jan 28Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (8)Used By (0)

Laravel N+1 Query Logger
========================

[](#laravel-n1-query-logger)

A Laravel package that detects and logs N+1 queries in your application, helping you optimize database performance by identifying inefficient queries.

Features
--------

[](#features)

- **Automatic Detection**: The package listens to all database queries and automatically detects potential N+1 query problems.
- **File &amp; Line Tracking**: Logs the file and line number where the N+1 query was triggered.
- **Logging**: Logs the detected N+1 queries including SQL, bindings, execution time, and the file/line number of the caller.
- **Environment-specific**: Only logs queries in non-production environments to avoid unnecessary logging in production.
- **Customizable Configuration**: You can enable/disable N+1 query logging and configure log levels through a config file.
- **Console Command**: View logged N+1 queries through an Artisan command.

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

[](#installation)

### Step 1: Install the package

[](#step-1-install-the-package)

Install the package via Composer:

```
composer require your-namespace/nplusone-logger
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

7

Last Release

521d ago

Major Versions

v1.5.0 → v2.0.02025-01-28

v2.5.0 → v3.0.02025-01-28

v3.5.0 → v4.0.02025-01-28

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851185?v=4)[snype](/maintainers/snype)[@snype](https://github.com/snype)

---

Top Contributors

[![snyype](https://avatars.githubusercontent.com/u/81408519?v=4)](https://github.com/snyype "snyype (7 commits)")

### Embed Badge

![Health badge](/badges/snype-nplusone/health.svg)

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

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[pgvector/pgvector

pgvector support for PHP

198741.5k12](/packages/pgvector-pgvector)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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