New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

squareboat/sql-doctor

Quickly debugging the amount of database queries per request in Laravel.
1,457 57
Install
composer require squareboat/sql-doctor
Latest Version:v3.0.0
PHP:>=5.4.0
Laravel:5
License:MIT
Last Updated:Oct 15, 2017
Links: GitHub  ·  Packagist
Maintainer: akaamitgupta

Debugging Database Queries

Quickly debugging the amount of database queries per request in Laravel.

sql-doctor example image

Install

Install via composer

For Laravel <= 5.3, please use the 1.1 branch!
$ composer require squareboat/sql-doctor

Configure Laravel

If you are using laravel 5.5 or higher you should skip this step.

If you are using laravel 5.4, simply add the service provider to your project's config/app.php file:

Service Provider
SquareBoat\SqlDoctor\SqlDoctorServiceProvider::class,

Usage

Now while your app.debug is set true then on any URL you can append ?sql-doctor=1 and get an output of complete list of queries that ran.

Query Param Value Output
sql-doctor 1 Default query
sql-doctor 2 Binds values to their parameters in the query.

Credits

SQL Doctor, originally developed after the reddit thread by magkopian.

License

The MIT License. Please see License File for more information. Copyright © 2017 SquareBoat

Related Packages

fitztrev/query-tracer

Backtrace database queries

20,026 228
sofa/laravel-db-queries-alert

Insanely simple check against DB querying abuse in Laravel app AKA Check Your Qu...

2,537 7
endeavour-agency/laravel-migration-tests

Provides tools for integration testing Laravel migrations.

3,820 5
endeavour-agency/refresh-database-on-demand

This packages offers a drop-in replacement for Laravel's RefreshDatabase trait,...

3,329 1
railroad/resora

A database access system.

90,607 0

Version History

Version Released PHP Laravel License
v3.0.0 >=5.4.0 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* MIT
v2.0.0 >=5.4.0 5.1.*|5.2.*|5.3.*|5.4.* MIT
v1.1.0 >=5.4.0 5.1.*|5.2.*|5.3.* MIT
v1.0.0 >=5.4.0 ~5.0 MIT