makfly/laravel-web-profiler

Symfony-style web profiler for Laravel with inline toolbar and React SPA dashboard

Maintainers

Package info

github.com/MakFly/laravel-web-profiler

Language:TypeScript

pkg:composer/makfly/laravel-web-profiler

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-03-08 22:40 UTC

This package is auto-updated.

Last update: 2026-03-08 22:43:57 UTC


README

Symfony-style web profiler for Laravel — inline debug toolbar + full-featured profiler dashboard.

PHP 8.2+ Laravel 11|12 License: MIT

Features

  • Debug Toolbar — Symfony-inspired toolbar injected at the bottom of every HTML page
  • Profiler Dashboard — React SPA accessible at /_profiler with full request inspection
  • 13 Data Collectors — Request, Time, Memory, Queries, Logs, Routes, Events, Exceptions, Cache, Mail, Views, Gate, HTTP Client
  • API ProfilingX-Debug-Token and X-Debug-Token-Link headers 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 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.

License

MIT