makfly / laravel-web-profiler
Symfony-style web profiler for Laravel with inline toolbar and React SPA dashboard
Package info
github.com/MakFly/laravel-web-profiler
Language:TypeScript
pkg:composer/makfly/laravel-web-profiler
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0
- illuminate/http: ^11.0|^12.0
- illuminate/routing: ^11.0|^12.0
- illuminate/support: ^11.0|^12.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
README
Symfony-style web profiler for Laravel — inline debug toolbar + full-featured profiler dashboard.
Features
- Debug Toolbar — Symfony-inspired toolbar injected at the bottom of every HTML page
- Profiler Dashboard — React SPA accessible at
/_profilerwith full request inspection - 13 Data Collectors — Request, Time, Memory, Queries, Logs, Routes, Events, Exceptions, Cache, Mail, Views, Gate, HTTP Client
- API Profiling —
X-Debug-TokenandX-Debug-Token-Linkheaders on every response (JSON, HTML, XML) - AJAX Interception — Automatic fetch/XHR monitoring with sub-request tracking in the toolbar
- Zero Configuration — Works out of the box when
APP_DEBUG=true
Screenshot
Coming soon
Requirements
- PHP 8.2+
- Laravel 11.x or 12.x
Installation
composer require makfly/laravel-web-profiler --dev
Publish the configuration (optional):
php artisan vendor:publish --tag=profiler-config
Configuration
| Option | Default | Description |
|---|---|---|
profiler.enabled |
APP_DEBUG |
Enable/disable the profiler |
profiler.path |
_profiler |
URL prefix for the profiler dashboard |
profiler.toolbar.enabled |
true |
Show the debug toolbar on HTML pages |
profiler.storage.driver |
file |
Storage driver (file) |
profiler.storage.max_profiles |
200 |
Maximum stored profiles before auto-purge |
profiler.storage.expiration |
86400 |
Profile TTL in seconds (24h) |
profiler.environments |
['local', 'testing'] |
Environments where the profiler is active |
Usage
Debug Toolbar
The toolbar is automatically injected into HTML responses. It displays:
- HTTP status code and method
- Response time
- Peak memory usage
- Database query count and duration
- Log count and errors
- AJAX sub-requests (with links to their profiles)
Click the profiler token link (top-right) to open the full profiler dashboard.
Profiler Dashboard
Navigate to /_profiler to browse all profiled requests. Filter by method, status code, URL, or IP address.
Click any profile to inspect the full request details across all collectors.
API Profiling
Every response includes profiling headers — no toolbar injection on non-HTML responses:
X-Debug-Token: a1b2c3d4e5f6
X-Debug-Token-Link: http://localhost:8000/_profiler/a1b2c3d4e5f6
Use these headers from any API client (Postman, curl, frontend SPA) to access the full profile:
curl -i http://localhost:8000/api/users # Look for X-Debug-Token-Link in response headers # Open that URL in your browser to see the full profile
This works seamlessly with API Platform, Sanctum, Passport, or any JSON API.
Collectors
| Collector | Key | Description |
|---|---|---|
| Request | request |
Headers, cookies, session, server variables |
| Time | time |
Total response time with stopwatch events |
| Memory | memory |
Peak memory usage, PHP memory limit |
| Query | query |
SQL queries with bindings, duration, slow/duplicate detection |
| Log | log |
Application log messages with levels and context |
| Route | route |
Matched route, controller, middleware stack |
| Event | event |
Dispatched events and listener counts |
| Exception | exception |
Caught exceptions with stack traces |
| Cache | cache |
Cache hits, misses, writes, deletes |
mail |
Sent emails with recipients and subjects | |
| View | view |
Rendered Blade views with data keys |
| Gate | gate |
Authorization checks and results |
| HTTP Client | http_client |
Outgoing HTTP requests via Laravel HTTP client |
Enable or disable collectors individually in config/profiler.php:
'collectors' => [ 'query' => true, 'log' => true, 'cache' => false, // disable cache collector // ... ],
Excluding Routes
Profiler routes (_profiler/*) are automatically excluded. Add custom exclusions:
'exclude_paths' => [ 'telescope*', 'horizon*', '_debugbar*', 'health-check', ],
Commands
# Purge all stored profiles php artisan profiler:purge # Check profiler status php artisan profiler:status
Contributing
Contributions are welcome! Please open an issue or submit a pull request.