laylatichy / tempest-debug-bar
Debug bar integration for the Tempest framework
Package info
gitlab.com/laylatichy_projects/tempest-debug-bar
pkg:composer/laylatichy/tempest-debug-bar
Requires
- php: ^8.5
- php-debugbar/php-debugbar: 3.5.1
- tempest/framework: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: 3.94.2
- phpstan/phpstan: 2.1.42
- phpunit/phpunit: 13.0.5
This package is auto-updated.
Last update: 2026-03-19 20:53:35 UTC
README
Debug bar integration for the Tempest framework, powered by PHP Debug Bar.
Zero-config: install the package and it auto-discovers via Tempest's discovery system. Shows query logs, route info, request/response data, and timing — injected into HTML responses during development.
Installation
composer require tempest/debug-bar --dev
That's it. The debug bar is disabled by default.
Configuration
Create a config file in your project (e.g. app/Config/debug-bar.config.php):
<?php
use Tempest\DebugBar\DebugBarConfig;
return new DebugBarConfig(
enabled: true,
slowQueryThreshold: 100.0,
);
The package ships with a default config where enabled is false. Override it in your app's config to activate the debug bar.
Config options
| Option | Type | Default | Description |
|---|---|---|---|
enabled | bool | false | Enable or disable the debug bar |
slowQueryThreshold | float | 100.0 | Threshold in ms to flag slow queries |
Collectors
| Collector | Tab | Data shown |
|---|---|---|
| Time | Timeline | Total request duration, application timing |
| Memory | - | Peak memory usage (indicator) |
| PHP Info | - | PHP version (indicator) |
| Request | Request | Method, URL, path, headers, query params, body, cookies, response status and headers |
| Route | Route details | Matched URI, HTTP method, controller::method, middleware stack, route params |
| Queries | Queries | SQL with bindings, execution time per query, total duration, query count |
How it works
DebugBarMiddlewareruns atPriority::EXCEPTION_HANDLINGto wrap the entire request lifecycle- Every response gets a
phpdebugbar-idheader with a unique request ID - HTML responses get the debug bar JS/CSS injected before
</body> - Data is stored to disk via
FileStorageand fetched by the JS client from/_debugbar/open - AJAX/Inertia navigation updates the debug bar automatically via the
AjaxHandler QueryCollectorlistens toQueryExecutedevents via#[EventHandler](registered as singleton)- Assets are served from the
php-debugbarvendor directory via/_debugbar/assets/{path} - Everything is auto-discovered by Tempest — no manual registration needed
- When
enabledisfalse, the middleware short-circuits immediately with zero overhead - Works with Inertia.js — debug data is fetched via the OpenHandler for both full page loads and XHR navigation
Development
Code Style
composer lint
Static Analysis
composer stan
Tests
composer test
All checks
composer check
License
Use at your own risk. See LICENSE.