fitztrev/query-tracer
最新稳定版本:1.0.2
Composer 安装命令:
composer require fitztrev/query-tracer
包简介
Backtrace database queries
README 文档
README
Find exactly where a specific database query is being called in your Laravel application.
Want to optimize or debug your database queries but not sure where they're being called? See how it works below with Clockwork:
If you use Debugbar, it has this functionality built-in if you set debugbar.options.db.backtrace to true.
Installation
-
Install via composer:
composer require fitztrev/query-tracer
-
Add the service provider to your
config/app.php:'providers' => [ // ... Fitztrev\QueryTracer\Providers\QueryTracerServiceProvider::class, ],
How does it do it?
It makes use of Laravel's global query scopes to do a backtrace and find where a query originated. Then it puts that info in extraneous but helpful WHERE clauses.
By default, it's only enabled when debug is on. You can change this behavior for specific models by adding an enableQueryTracer() method to your model(s). For example:
public function enableQueryTracer() { return config('app.env') == 'local'; }
统计信息
- 总下载量: 19.79k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 232
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-09