PHPackages                             zhy-code/laravel-sql-trace - 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. zhy-code/laravel-sql-trace

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

zhy-code/laravel-sql-trace
==========================

SQL Trace For Laravel

1.0.1(1y ago)06MITPHPPHP ^7.3

Since Jul 29Pushed 1y ago1 watchersCompare

[ Source](https://github.com/zhy-code/laravel-sql-trace)[ Packagist](https://packagist.org/packages/zhy-code/laravel-sql-trace)[ RSS](/packages/zhy-code-laravel-sql-trace/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Laravel-SQL-Trave
=================

[](#laravel-sql-trave)

### 介绍

[](#介绍)

利用 Laravel 框架本身的 SQL 监控，通过 SQL 监听，完成 SQL 的日志记录; 主要应用于本地/测试环境的开发，涉及 SQL 日志，不要用于生产环境！！！
该生成的日志，可以直接使用，也可以配合 LogViewer 工具使用（最佳实践方案）

### 部署

[](#部署)

#### composer 加载

[](#composer-加载)

```
  cd project
  composer require zhy-code/laravel-sql-trace:1.0.1
  git checkout composer.json
  php artisan package:discover

```

#### 修改配置文件

[](#修改配置文件)

```
   verdor/zhy-code/laravel-sql-trace/config/sql_trace.php

```

### 配合 LogViewer 的内容

[](#配合-logviewer-的内容)

#### 正则表达式

[](#正则表达式)

```
    public static string $regex = '/^{"level":"(?.*)","app_env":"(?\S+)","app_name":"(?\S+)","req_uri":"(?\S+)","req_method":"(?\S+)","req_body":(?.*),"db_conf":(?.*),"db_connection_name":"(?.*)","trace_id":"(?.*)","trace_datetime":"(?.*)","trace_sql_bindings":(?.*),"execute_sql":"(?.*)","execute_ms":(?.*)}/';

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/da43839a262cc5345b67ac0d69cea6064e7893a43a3368d1bce6e6fc2a7d4bb4?d=identicon)[zhy-code](/maintainers/zhy-code)

---

Top Contributors

[![zhy-code](https://avatars.githubusercontent.com/u/20496067?v=4)](https://github.com/zhy-code "zhy-code (9 commits)")

### Embed Badge

![Health badge](/badges/zhy-code-laravel-sql-trace/health.svg)

```
[![Health](https://phpackages.com/badges/zhy-code-laravel-sql-trace/health.svg)](https://phpackages.com/packages/zhy-code-laravel-sql-trace)
```

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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