clcbws / laravel-agents-debug
A Zero-JS, High-Fidelity Server-Side Diagnostics & Profiling Suite for Laravel 12/13.
Package info
github.com/ahtesham-clcbws/laravel-agents-debug
pkg:composer/clcbws/laravel-agents-debug
Requires
- php: ^8.3|^8.4
- illuminate/console: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/http: ^12.0|^13.0
- illuminate/log: ^12.0|^13.0
- illuminate/session: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^10.0
README
A zero-JS, high-fidelity server-side diagnostics & profiling suite for Laravel 12.x / 13.x
What Is It?
Laravel Agent-Debugger is a premium require-dev diagnostic middleware suite that runs 100% server-side. It produces richly structured, compact log files designed to be read by both human developers and AI coding agents β with zero frontend JavaScript overhead, zero Composer runtime dependencies, and zero production leakage.
Quick Start
composer require --dev clcbws/laravel-agents-debug
php artisan vendor:publish --provider="LaravelAgentDebugger\DebugActivityServiceProvider"
php artisan agent:debug-on
Then visit your visual dashboard:
http://localhost/_agent_debug/dashboard
β¨ Feature Overview (v3.1.1 β 13 Dashboard Tabs & 29 Server-Side Profilers)
π Core Diagnostics
| # | Feature | Description |
|---|---|---|
| 1 | π΄ Floating Viewport Badge | Glassmorphic real-time badge showing duration, memory & query count |
| 2 | π§ Session Breadcrumb Trail | Last-10-request navigation map with status codes |
| 3 | πͺ Caught Exception Tracker | Surfaces silently swallowed try-catch redirects |
| 4 | π³ DB Transaction Auditor | Inline beginTransaction, commit, rollBack sequence logger |
| 5 | β οΈ N+1 Query Loop Detector | Flags queries running 5+ times with eager-load remedies |
| 6 | π Config & Env Drift Detector | SHA-256 diff between requests for .env key changes |
| 7 | ποΈ Blade Compiler Resolver | Maps compiled view paths back to physical .blade.php lines |
| 8 | π‘οΈ Gate & Policy Profiler | Logs all authorization ability evaluations and outcomes |
| 9 | πΎ Session State Logger | Exposes developer-defined session variables per request |
| 10 | π€ Actor Enrichment Card | Maps authenticated User ID to email/username profile |
ποΈ Database & Query Intelligence
| # | Feature | Description |
|---|---|---|
| 11 | π¬ Visual SQL EXPLAIN Analyzer | Runs EXPLAIN on any query and visualizes index scan plans |
| 12 | π₯ Duplicate & Redundant Query Detector | Flags exact duplicate queries with caching advice |
| 13 | π Interactive SQL Playground | Safe read-only live SELECT terminal inside the dashboard |
| 14 | πΎ SQL Database Index Advisor | Heuristic WHERE/JOIN column analysis with migration code |
π’ Async & Side-Effect Telemetry
| # | Feature | Description |
|---|---|---|
| 15 | π§ Queue Job & Event Payload Serializer | Captures dispatched event/job payloads |
| 16 | π§ Outgoing Mail Sandbox | Intercepts Mailables and renders HTML previews in-dashboard |
| 17 | ποΈ Cache Hit/Miss Monitor | Tracks get/put/forget with keys, TTLs, and byte sizes |
| 18 | π Eloquent Model Lifecycle Tracker | Logs creating, created, updating, deleting observers |
β±οΈ Visual Profiling & Timelines
| # | Feature | Description |
|---|---|---|
| 19 | β±οΈ DevTools-Style Timeline Waterfall | Proportional Gantt chart of Boot β DB β Spans β HTTP |
| 20 | πΊοΈ Blade Template Composition Tree | Visual nesting sequence flowchart for view hierarchies |
| 21 | π Live PHP Memory Flame-Graph | Real memory_get_peak_usage() layered allocation breakdown |
| 22 | π Outgoing Latency Radar | DB vs app overhead performance ratio meters |
π οΈ Environment, Security & DevOps
| # | Feature | Description |
|---|---|---|
| 23 | π Livewire Hydration State Tracker | Discrete state dumps for Livewire component updates |
| 24 | π¨ Dev Environment Config Shield | TCP socket checks for Redis and SMTP on artisan serve |
| 25 | πͺ Cookie & CSRF Token Debugger | Demystifies silent 419 Page Expired errors |
| 26 | βοΈ .env vs .env.example Diff Audit | Side-by-side grid of missing or drifted config keys |
| 27 | π·οΈ Category Tag Filtering (?_debug_tag=x) |
URL-appended tags for scoped log filtering |
| 28 | π©Ή Composer Security Auditor | CVE advisory scan of composer.lock packages |
| 29 | π Git Branch Correlation Analyzer | Active branch badge and uncommitted file diff warnings |
π₯οΈ Dashboard & Streaming
| # | Feature | Description |
|---|---|---|
| 30 | πΏ Real-time SSE Log Streaming | Persistent EventSource stream with AJAX fallback |
| 31 | π Outgoing API Mock Interceptor | UI rule builder for Http::fake() JSON stubs |
| 32 | π§ͺ Browser-Based PHPUnit Runner | One-click in-dashboard test suite executor |
| 33 | π οΈ Artisan Quick-Console | Cache, route, and debug-clean from the dashboard header |
Artisan CLI Commands
php artisan agent:debug-on # Enable profiling php artisan agent:debug-off # Disable profiling php artisan agent:debug-status # Show current config & storage footprint php artisan agent:debug-clean # Purge log files (--days=X optional) php artisan agent:debug-tail # Live CLI log stream php artisan agent:debug-record # Export session as portable .md/.json bundle
Dashboard Routes
| Route | Method | Description |
|---|---|---|
/_agent_debug/dashboard |
GET | Visual SPA profiling dashboard |
/_agent_debug/logs |
GET | Raw JSON log data |
/_agent_debug/sse |
GET | Server-Sent Events live stream |
/_agent_debug/explain |
POST | Run EXPLAIN on a SQL query |
/_agent_debug/playground |
POST | Execute a safe SELECT query |
/_agent_debug/run-tests |
POST | Execute PHPUnit feature tests |
/_agent_debug/mocks |
GET | List active HTTP mock rules |
/_agent_debug/mock-save |
POST | Save HTTP mock interceptor rules |
/_agent_debug/artisan/{cmd} |
POST | Run Artisan quick-console commands |
Documentation
- Vision β https://ahtesham-clcbws.github.io/laravel-agents-debug/vision
- Core Features β https://ahtesham-clcbws.github.io/laravel-agents-debug/features
- Configuration β https://ahtesham-clcbws.github.io/laravel-agents-debug/configuration
- Artisan CLI Guide β https://ahtesham-clcbws.github.io/laravel-agents-debug/artisan
- Log Schema β https://ahtesham-clcbws.github.io/laravel-agents-debug/schema
- Changelog v3.1.1 β https://ahtesham-clcbws.github.io/laravel-agents-debug/changelogs/v3.1.1
- Changelog v3.1.0 β https://ahtesham-clcbws.github.io/laravel-agents-debug/changelogs/v3.1.0
- Changelog v2.9.0 β https://ahtesham-clcbws.github.io/laravel-agents-debug/changelogs/v2.9.0
Origin Story
"I developed this package because in some projects I had to spend a lot of time just explaining the problem to my AI coding agents. I started with a lightweight middleware helper and kept adding features. Soon I realized other developers faced the same bottleneck, so I decided to share it with the community. This is an invention of need." β Ahtesham
