PHPackages                             mll-lab/laravel-query-log - 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. mll-lab/laravel-query-log

Abandoned → [See https://github.com/mll-lab/laravel-query-log README for a recipe to replace this](/?search=See%20https%3A%2F%2Fgithub.com%2Fmll-lab%2Flaravel-query-log%20README%20for%20a%20recipe%20to%20replace%20this)ArchivedLibrary[Database &amp; ORM](/categories/database)

mll-lab/laravel-query-log
=========================

Log database queries to an output channel of your choice

v2.3.0(3y ago)319.2kMITPHPPHP ^7.2 || ^8

Since Dec 5Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mll-lab/laravel-query-log)[ Packagist](https://packagist.org/packages/mll-lab/laravel-query-log)[ RSS](/packages/mll-lab-laravel-query-log/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (0)

You can easily implement what this package does by adding something like this to `DatabaseServerProvider::boot()`:

```
if (env('APP_DEBUG')) {
    DB::listen(function (QueryExecuted $query): void {
        $sql = str_replace("\n", ' ', $query->sql);
        $bindings = \Safe\json_encode($query->bindings);

        \Safe\file_put_contents(
            filename: storage_path('logs/query.log'),
            data: "SQL: {$sql} ||| Bindings: {$bindings} ||| Time: {$query->time}ms\n",
            flags: FILE_APPEND,
        );
    });
}
```

laravel-query-log
=================

[](#laravel-query-log)

Log database queries to an output channel of your choice.

[![codecov](https://camo.githubusercontent.com/3d04ac24471002f687ac251721456415d94f067b0c101fa20c75e4825cb37b66/68747470733a2f2f636f6465636f762e696f2f67682f6d6c6c2d6c61622f6c61726176656c2d71756572792d6c6f672f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/mll-lab/laravel-query-log)[![GitHub license](https://camo.githubusercontent.com/cc815ef994cf9dfd82fb94daaadafd1532fe115c55abc62a131040e00715fdc4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d6c6c2d6c61622f6c61726176656c2d71756572792d6c6f672e737667)](https://github.com/mll-lab/laravel-query-log/blob/master/LICENSE)

[![Packagist](https://camo.githubusercontent.com/066abad6e7f2d7d722bfaab0aaac4bbf4ab8c3ef8a74a044a950bf1e1774b8be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6c6c2d6c61622f6c61726176656c2d71756572792d6c6f672e737667)](https://packagist.org/packages/mll-lab/laravel-query-log)[![Packagist](https://camo.githubusercontent.com/9474d59d087088063cdda86f4b3a21aafd8a5f5dd24c1297d05adfe00299a8e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6c6c2d6c61622f6c61726176656c2d71756572792d6c6f672e737667)](https://packagist.org/packages/mll-lab/laravel-query-log)

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

[](#installation)

```
composer require mll-lab/laravel-query-log

```

That's it. Laravel's package discovery will automatically kick in.

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

[](#configuration)

All database queries are written to `storage/logs/query.log` by default. If you want to change the location, publish the configuration file:

```
php artisan vendor:publish --tag=query-log-config

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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 ~223 days

Total

5

Last Release

1457d ago

Major Versions

v1.0.0 → v2.0.02020-05-07

PHP version history (3 changes)v1.0.0PHP &gt;=7.1

v2.0.0PHP ^7.2

v2.2.0PHP ^7.2 || ^8

### Community

Maintainers

![](https://www.gravatar.com/avatar/2ff5d1af2c0f601f7ed7e75e15be0aa4c062149b57fd5aace4e44cc37b8b7a40?d=identicon)[spawnia](/maintainers/spawnia)

---

Top Contributors

[![spawnia](https://avatars.githubusercontent.com/u/12158000?v=4)](https://github.com/spawnia "spawnia (18 commits)")

---

Tags

phplaraveldatabase

### Embed Badge

![Health badge](/badges/mll-lab-laravel-query-log/health.svg)

```
[![Health](https://phpackages.com/badges/mll-lab-laravel-query-log/health.svg)](https://phpackages.com/packages/mll-lab-laravel-query-log)
```

###  Alternatives

[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[renoki-co/l1

Laravel integration for Cloudflare Workers services.

16113.1k](/packages/renoki-co-l1)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[tomatophp/filament-locations

Database Seeds for Countries / Cities / Areas / Languages / Currancy with ready to use resources for FilamentPHP

2320.8k6](/packages/tomatophp-filament-locations)[calebdw/laravel-sql-entities

Manage SQL entities in Laravel with ease.

301.3k](/packages/calebdw-laravel-sql-entities)

PHPackages © 2026

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