squareboat/sql-doctor

Quickly debugging the amount of database queries per request in Laravel.
1,456 57
Install
composer require squareboat/sql-doctor
Latest Version:v3.0.0
PHP:>=5.4.0
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,020 228
oscaragcp/sql-logging

Laravel 5 package for logging SQL queries.

120 2
lanin/laravel-api-debugger

Easily debug your JSON API.

1,941,530 232
libern/laravel-sql-logging

Laravel 5 package for logging SQL queries.

4,599 0
saad/api-debugger

Easily debug your JSON API.

78,381 11

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