2017 © Pedro Peláez
 

library query-tracer

Backtrace database queries

image

fitztrev/query-tracer

Backtrace database queries

  • Sunday, May 22, 2016
  • by fitztrev
  • Repository
  • 9 Watchers
  • 237 Stars
  • 10,152 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 1 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Laravel Query Tracer

Build Status Latest Stable Version, (*1)

Find exactly where a specific database query is being called in your Laravel application., (*2)

Want to optimize or debug your database queries but not sure where they're being called? See how it works below with Clockwork:, (*3)

, (*4)

If you use Debugbar, it has this functionality built-in if you set debugbar.options.db.backtrace to true., (*5)

Installation

  1. Install via composer:, (*6)

    composer require fitztrev/query-tracer
    
  2. Add the service provider to your config/app.php:, (*7)

    '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., (*8)

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:, (*9)

public function enableQueryTracer()
{
    return config('app.env') == 'local';
}

The Versions

22/05 2016

dev-master

9999999-dev

Backtrace database queries

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel debug eloquent

22/05 2016

1.0.2

1.0.2.0

Backtrace database queries

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel debug eloquent

18/05 2016

1.0.1

1.0.1.0

Backtrace database queries

  Sources   Download

MIT

The Requires

 

The Development Requires

database laravel debug eloquent

09/05 2016

1.0.0

1.0.0.0

Backtrace database queries

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

database laravel debug eloquent