mr-sabya/querylens

A modern API debugging and query profiling tool for Laravel.

Maintainers

Package info

github.com/mr-sabya/querylens-package

pkg:composer/mr-sabya/querylens

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.2 2026-05-07 14:39 UTC

This package is auto-updated.

Last update: 2026-05-07 14:39:49 UTC


README

QueryLens is a modern, lightweight, and high-performance API debugging and SQL profiling tool for Laravel. It provides a real-time dashboard to monitor your application's database activity and API performance without unnecessary complexity.

Latest Version on Packagist Total Downloads

โœจ Features

  • โšก Zero-Configuration Setup
  • ๐Ÿ›  Deep SQL Query Profiling
  • ๐Ÿ“Š Real-Time Request Monitoring
  • ๐Ÿง  Query Execution Time Analysis
  • ๐ŸŽจ Modern Dark UI Dashboard
  • ๐Ÿ“ฆ Dedicated SQLite Storage
  • ๐Ÿš€ Lightweight & Fast
  • ๐Ÿ”ฅ Slow Query Detection
  • ๐Ÿ“ฑ Mobile Responsive Interface
  • ๐Ÿ” Request & Response Inspection

๐Ÿ’ป Requirements

Requirement Version
PHP ^8.2
Laravel ^10.0 | ^11.0 | ^12.0

๐Ÿ“ฆ Installation

Install the package via Composer:

composer require mr-sabya/querylens

Run the installation command:

php artisan querylens:install

This command will:

  • Publish configuration files
  • Create QueryLens storage
  • Prepare SQLite logging database
  • Register required assets

โš™๏ธ Configuration

After installation, configure QueryLens from:

config/querylens.php

Example configuration:

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Enable QueryLens
    |--------------------------------------------------------------------------
    */

    'enabled' => env('QUERYLENS_ENABLED', true),

    /*
    |--------------------------------------------------------------------------
    | Dashboard URI
    |--------------------------------------------------------------------------
    */

    'uri' => 'querylens',

    /*
    |--------------------------------------------------------------------------
    | Slow Query Threshold (milliseconds)
    |--------------------------------------------------------------------------
    */

    'slow_query_threshold' => 500,

    /*
    |--------------------------------------------------------------------------
    | Middleware
    |--------------------------------------------------------------------------
    */

    'middleware' => [
        'web',
        // 'auth',
    ],

    /*
    |--------------------------------------------------------------------------
    | Maximum Stored Logs
    |--------------------------------------------------------------------------
    */

    'max_logs' => 5000,

];

๐Ÿš€ Usage

Start your Laravel application:

php artisan serve

Open the dashboard in your browser:

http://127.0.0.1:8000/querylens

QueryLens will automatically record:

  • HTTP Requests
  • API Calls
  • SQL Queries
  • Query Bindings
  • Response Time
  • Memory Usage
  • Slow Queries
  • Request Timeline

๐Ÿ“Š Dashboard Preview

The dashboard includes:

Request Monitoring

  • HTTP Method
  • Route Path
  • Response Status
  • Request Duration

SQL Query Insights

  • Raw SQL Query
  • Query Bindings
  • Execution Time
  • Source File & Line

Performance Analysis

  • Memory Consumption
  • Slow Query Alerts
  • Duplicate Query Detection

๐Ÿ”ฅ Slow Query Detection

Queries slower than the configured threshold will automatically be highlighted.

Example:

โš  Slow Query Detected (842ms)

๐Ÿ—‚ Storage

QueryLens uses a dedicated SQLite database for storing logs.

This keeps your primary application database clean and optimized.

๐Ÿ” Security

QueryLens is intended for local and development environments.

Disable it in production:

QUERYLENS_ENABLED=false

You may also protect the dashboard using authentication middleware:

'middleware' => [
    'web',
    'auth',
],

๐Ÿงช Example Query Log

select * from users where email = ?

Execution details:

Duration: 12ms
Connection: mysql
Memory: 4MB

๐Ÿ“ Package Structure

src/
โ”œโ”€โ”€ Commands/
โ”œโ”€โ”€ Facades/
โ”œโ”€โ”€ Http/
โ”‚   โ”œโ”€โ”€ Controllers/
โ”‚   โ””โ”€โ”€ Middleware/
โ”œโ”€โ”€ Listeners/
โ”œโ”€โ”€ Models/
โ”œโ”€โ”€ Providers/
โ”œโ”€โ”€ Services/
โ”œโ”€โ”€ Support/
โ”œโ”€โ”€ resources/
โ”‚   โ”œโ”€โ”€ views/
โ”‚   โ”œโ”€โ”€ js/
โ”‚   โ””โ”€โ”€ css/
โ””โ”€โ”€ config/

๐Ÿ›  Roadmap

  • Live AJAX Auto Refresh
  • Real-Time WebSocket Monitoring
  • Redis Monitoring
  • Queue Monitoring
  • Exception Tracking
  • Export Logs
  • Multi-Project Support

๐Ÿค Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a new feature branch
  3. Commit your changes
  4. Push your branch
  5. Open a Pull Request

๐Ÿ“„ License

This package is open-sourced software licensed under the MIT license.

โญ Support

If you find QueryLens useful, consider starring the repository on GitHub.