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 1mo ago

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 49% of packages

Maintenance42

Moderate activity, may be stable

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

475d 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://www.gravatar.com/avatar/ed539f4247bc79f20dd9c0da268eaaecee50088881039eac9e49e49a8bd159bb?d=identicon)[snype](/maintainers/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

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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