Download the PHP package ahmedmashhour/laravel-query-debugger without Composer

On this page you can find all versions of the php package ahmedmashhour/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

Automatic query tracking, analysis, and debugging for Laravel applications with N+1 detection, slow query monitoring, and performance insights.

Features

Installation

Option 1: Install from GitHub (Recommended)

Add the package repository to your composer.json:

Then install via Composer:

Or specify a specific version/tag:

Option 2: Install from Local Path

Add the package to your composer.json:

Run composer install:

Step 2: Publish Configuration (Optional)

Step 3: Configure

Add to your .env:

Configuration

Quick Start - Key Environment Variables

Basic Settings

Storage

N+1 Detection

API Response Injection

Alerts

Usage

Enable for Development

Enable for Specific Request

Summary Response (default - QUERY_DEBUG_FULL_QUERIES_IN_RESPONSE=false):

Full Response (with QUERY_DEBUG_FULL_QUERIES_IN_RESPONSE=true):

Query Analysis: EXPLAIN vs EXPLAIN ANALYZE

The package supports two levels of query analysis for slow queries:

EXPLAIN (Execution Plan)

Example output:

EXPLAIN ANALYZE (Detailed Execution Stats)

Example output:

Configuration Options:

  1. Slow Queries Only (Recommended)

    • Use when: You want to analyze only problematic queries
    • Overhead: Low-Medium
    • Best for: Production/staging environments
  2. Both EXPLAIN and EXPLAIN ANALYZE for Slow Queries

    • Use when: You need both execution plans and detailed stats
    • Overhead: Medium
  3. All Queries (Deep Debugging)

    • Use when: You need to analyze every single query in a request
    • Overhead: High-Very High (use sparingly!)
    • Best for: Local debugging only

Important Notes:

Recommendation:

View Logs

Analyze Queries

Clean Old Logs

JSON Log Format

Queries are stored as a JSON array with pretty formatting for easy reading:

Per-Route Configuration

Override settings for specific routes:

Performance

Overhead

Optimization Tips

  1. Use sampling in production: QUERY_DEBUG_SAMPLING=10
  2. Disable backtrace: QUERY_DEBUG_BACKTRACE=false
  3. Disable EXPLAIN: QUERY_DEBUG_ANALYZE=false
  4. Use exclude patterns for known queries
  5. Enable only in local/staging environments

Multi-Tenant Support

Optional tenant context capture for multi-tenant applications:

The package works with any Laravel application - multi-tenant or single-tenant!

Advanced Features

Exclude Patterns

Skip tracking specific queries:

Metadata Collection

Configure what metadata to collect:

Troubleshooting

Queries Not Being Logged

  1. Check QUERY_DEBUG_ENABLED=true in .env
  2. Verify connection is in connections array
  3. Check sampling rate: QUERY_DEBUG_SAMPLING=100
  4. Look for exclude patterns matching your queries

High Overhead

  1. Reduce sampling: QUERY_DEBUG_SAMPLING=10
  2. Disable backtrace: QUERY_DEBUG_BACKTRACE=false
  3. Disable EXPLAIN: QUERY_DEBUG_ANALYZE=false
  4. Add exclude patterns for frequent queries

Logs Not Rotating

  1. Check file permissions on storage/logs/queries/
  2. Verify max_file_size_mb setting
  3. Run php artisan query-debugger:clear manually

License

MIT

Support

For issues and questions, please open an issue on the GitHub repository.


All versions of laravel-query-debugger with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0
illuminate/database Version ^10.0
illuminate/http Version ^10.0
illuminate/console Version ^10.0
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 ahmedmashhour/laravel-query-debugger contains the following files

Loading the files please wait ...