PHPackages                             ka4ivan/laravel-api-debugger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. ka4ivan/laravel-api-debugger

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

ka4ivan/laravel-api-debugger
============================

A debugging tool for Laravel APIs that provides request execution time and query profiling.

2.0.0(9mo ago)6598↓40%MITPHPPHP ^8.0.2

Since Feb 25Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/ka4ivan/laravel-api-debugger)[ Packagist](https://packagist.org/packages/ka4ivan/laravel-api-debugger)[ RSS](/packages/ka4ivan-laravel-api-debugger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (8)Used By (0)

A debugging tool for Laravel APIs
=================================

[](#a-debugging-tool-for-laravel-apis)

[![License](https://camo.githubusercontent.com/7ba28670773415d9ec68512f543563191b692bc5993d8961fe7398dc5383b68e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6b61346976616e2f6c61726176656c2d6170692d64656275676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/ka4ivan/laravel-api-debugger)[![Build Status](https://camo.githubusercontent.com/483c33538fe0f7e58e4b81dcd529475892fcc2a709609d1b971a350a7371e44e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6b61346976616e2f6c61726176656c2d6170692d64656275676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://github.com/ka4ivan/laravel-api-debugger)[![Latest Stable Version](https://camo.githubusercontent.com/6e7eb6fe4d35af0d83d260a4c7f23ed3d294e32bb83d1e9e5a258ace0448ccc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b61346976616e2f6c61726176656c2d6170692d64656275676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/ka4ivan/laravel-api-debugger)[![Total Downloads](https://camo.githubusercontent.com/13dfb9b5c65b9643985f1a71ce3deb8dc2edc1a0e581c2e62c676a1df213f4bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61346976616e2f6c61726176656c2d6170692d64656275676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/ka4ivan/laravel-api-debugger)[![Quality Score](https://camo.githubusercontent.com/3f3f5fa8a7c5810c517fe8719d3a8fa8831ab4578e1de3e7fa78898af897b31d/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6b61346976616e2f6c61726176656c2d6170692d64656275676765722e7376673f7374796c653d666f722d7468652d6261646765)](https://scrutinizer-ci.com/g/ka4ivan/laravel-api-debugger/?branch=main)

Installation
------------

[](#installation)

1. Require this package with composer

```
composer require ka4ivan/laravel-api-debugger --dev
```

2. Debug works if the `APP_DEBUG` = `true`

### How it works

[](#how-it-works)

- The debugger will start logging SQL queries and request data for every API request.
- It will only activate if `APP_DEBUG=true` in your `.env` file.
- The results, including query count, execution time, and detailed data, will be attached to the API response for debugging purposes.

### Example

[](#example)

When you send an API request and `APP_DEBUG=true`, you'll receive the following debug data in the response:

```
{
    "data": {
        "..."
    },
    "debugger": {
        "queries": {
            "count": 8,
            "time": 14.57,
            "data": [
                {
                    "sql": "select * from `domains` where `is_active` = ? limit 1",
                    "bindings": [true],
                    "time": 10.09,
                    "trace": [
                        "/var/www/html/app/Support/Domains/Domain.php:101",
                        "/var/www/html/app/Http/Middleware/SetClientDomain.php:32",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `products` limit 1",
                    "bindings": [],
                    "time": 0.75,
                    "trace": [
                        "/var/www/html/app/Http/Controllers/ProductController.php:27",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `menu_items` where (`domain_id` = ? or `domain_id` is null) order by `weight` asc",
                    "bindings": ["8e591823-4f64-4e90-b564-e0c090696d6e"],
                    "time": 0.82,
                    "trace": [
                        "/var/www/html/app/Support/Menu/MenuLoader.php:17",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `pages` where `slug` = ? and (`domain_id` = ? or `domain_id` is null) and `status` = ? order by `weight` asc, `created_at` asc limit 1",
                    "bindings": ["contacts", "8e591823-4f64-4e90-b564-e0c090696d6e", "published"],
                    "time": 0.76,
                    "trace": [
                        "/var/www/html/app/Support/Pages/PageService.php:89",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `comparisons` where `guest_id` = ?",
                    "bindings": ["62afacc1-37b2-464d-8028-818745e56de5"],
                    "time": 0.61,
                    "trace": [
                        "/var/www/html/app/Http/Middleware/ComparisonMiddleware.php:19",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `comparisons` where `guest_id` = ?",
                    "bindings": ["62afacc1-37b2-464d-8028-818745e56de5"],
                    "time": 0.61,
                    "trace": [
                        "/var/www/html/app/Http/Middleware/ComparisonMiddleware.php:20",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `comparisons` where `guest_id` = ?",
                    "bindings": ["62afacc1-37b2-464d-8028-818745e56de5"],
                    "time": 0.63,
                    "trace": [
                        "/var/www/html/app/Http/Middleware/ComparisonMiddleware.php:21",
                        "/var/www/html/public/index.php:51"
                    ]
                },
                {
                    "sql": "select * from `seos` where `path` = ? limit 1",
                    "bindings": [""],
                    "time": 0.93,
                    "trace": [
                        "/var/www/html/app/Http/Controllers/SeoController.php:14",
                        "/var/www/html/public/index.php:51"
                    ]
                }
            ],
            "long_queries": [
                {
                    "query": "select * from `domains` where `is_active` = ? limit 1",
                    "bindings": [
                        true
                    ],
                    "time": 10.09,
                    "trace": [
                        "/var/www/html/app/Support/Domains/Domain.php:101",
                        "/var/www/html/app/Http/Middleware/SetClientDomain.php:32",
                        "/var/www/html/public/index.php:51"
                    ]
                }
            ],
            "repeated_queries": [
                {
                    "query": "select * from `comparisons` where `guest_id` = ?",
                    "count": 3,
                    "backtrace": [
                          [
                              "/var/www/html/app/Http/Middleware/ComparisonMiddleware.php:19",
                              "/var/www/html/public/index.php:51"
                          ],
                          [
                              "/var/www/html/app/Http/Middleware/ComparisonMiddleware.php:20",
                              "/var/www/html/public/index.php:51"
                          ],
                          [
                              "/var/www/html/app/Http/Middleware/ComparisonMiddleware.php:21",
                              "/var/www/html/public/index.php:51"
                          ]
                      ]
                }
            ]
        },
        "request": {
            "body": [],
            "headers": {
                "connection": [
                    "keep-alive"
                ],
                "accept-encoding": [
                    "gzip, deflate, br"
                ],
                "host": [
                    "dev-packages.test"
                ],
                "postman-token": [
                    "8654756-6abf-4511-9b91-72865463"
                ],
                "user-agent": [
                    "PostmanRuntime/7.37.3"
                ],
                "authorization": [
                    "Bearer 8|vxwhATRrOfinZiR4zvhoTpckGqYJTPnmj9tkOfdMb5d9da28"
                ],
                "accept": [
                    "application/json"
                ]
            }
        }
    }
}
```

### License

[](#license)

This package is licensed under the [MIT License](https://opensource.org/licenses/MIT). You can freely use, modify, and distribute this package, provided that you include a copy of the license in any redistributed software.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance56

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Recently: every ~37 days

Total

7

Last Release

294d ago

Major Versions

1.x-dev → 2.0.02025-07-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/2686db262a5d5b2c9fc09afbff60bf7d1600cc0220bc1b90b4c90c62963d56df?d=identicon)[ka4ivan](/maintainers/ka4ivan)

---

Top Contributors

[![ka4ivan](https://avatars.githubusercontent.com/u/75951574?v=4)](https://github.com/ka4ivan "ka4ivan (20 commits)")

---

Tags

apilaravelmonitoringdebugprofilerdebugbarperformancequery logkachularequest-debug

### Embed Badge

![Health badge](/badges/ka4ivan-laravel-api-debugger/health.svg)

```
[![Health](https://phpackages.com/badges/ka4ivan-laravel-api-debugger/health.svg)](https://phpackages.com/packages/ka4ivan-laravel-api-debugger)
```

###  Alternatives

[jackwh/laravel-new-relic

Monitor your Laravel application performance with New Relic

112827.2k](/packages/jackwh-laravel-new-relic)[scoutapp/scout-apm-laravel

Scout Application Performance Monitoring Agent - https://scoutapm.com

23831.3k](/packages/scoutapp-scout-apm-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
