Download the PHP package mashiur-softzino/laravel-query-debugger without Composer

On this page you can find all versions of the php package mashiur-softzino/laravel-query-debugger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-query-debugger

Laravel Query Debugger

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Auto-detect N+1 queries, duplicate queries, slow queries, and get actionable optimization suggestions for your Laravel Eloquent queries.

Stop wasting hours debugging query performance! This package automatically detects N+1 query problems, identifies slow queries, duplicate queries, SELECT * issues, and provides you with exact code suggestions to fix them.

Features

Screenshots

Visual Debug Toolbar (Collapsed)

Visual Debug Toolbar (Expanded)

Installation

You can install the package via composer:

The package will automatically register itself via Laravel's auto-discovery.

Configuration

Publish the configuration file (optional):

This will create a config/query-debugger.php file where you can customize:

Environment Variables

Add these to your .env file:

Usage

Visual Debug Toolbar (Recommended)

The package automatically injects a debug toolbar at the bottom of your HTML pages. No configuration needed!

Features:

Middleware Setup

Add the middleware to see the toolbar. In app/Http/Kernel.php:

Or for Laravel 11+ in bootstrap/app.php:

Command Line Usage

You'll get a beautiful console output showing:

Command Options

Using the Facade

You can also interact with the query logger programmatically:

Performance Scoring

The package calculates a performance score (0-100) based on:

Factor Impact
Total queries > 10 -5 points
Total queries > 20 -10 points
Total time > 100ms -5 points
Total time > 500ms -15 points
Each N+1 issue -15 points (max -30)
Each duplicate query -5 points (max -15)
Each SELECT * query -2 points (max -10)
Slow queries -5 points each (max -15)

Grade Scale

Score Grade Label
95-100 A+ Excellent
85-94 A Good
70-84 B Needs Improvement
50-69 C Poor
25-49 D Very Poor
0-24 F Critical

Real-World Examples

N+1 Problem Detection

Your Code:

Package Output:

Fixed Code:

Duplicate Query Detection

Your Code:

Package Output:

SELECT * Warning

Your Code:

Package Output:

Configuration Reference

Thresholds

Detection Settings

Middleware Settings

Context Tracking

Note: Uses debug_backtrace() which has performance overhead. Automatically disabled in production.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

Support

If you find this package helpful, please consider giving it a ⭐ on GitHub!

For issues or questions, please open an issue on GitHub.


All versions of laravel-query-debugger with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^10.0||^11.0||^12.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mashiur-softzino/laravel-query-debugger contains the following files

Loading the files please wait ...