leventcz/laravel-top
Laravel Top is a lightweight CLI dashboard for real-time monitoring of Laravel apps in production. It listens to request events and aggregates short-lived metrics in Redis to show throughput, latency, errors, and busiest routes across all servers.
composer require leventcz/laravel-top.redis is configured as a database connection in config/database.php (e.g., redis://127.0.0.1:6379) and Redis 5.0+ is running.php artisan top — instantly see real-time HTTP metrics: requests/sec, memory, duration, DB queries, cache hits/misses, and top 20 busiest routes.php artisan top while triggering endpoints via curl or browser — watch metrics update live to catch performance regressions or route hotspots.php artisan top running to inspect traffic surges, high-memory routes, or slow DB queries as they happen — no logs or APM setup needed.top aggregates metrics from all workers/servers via shared Redis — giving a unified view of application load across infrastructure.Top facade inside a custom Artisan command (e.g., php artisan metrics:health) to programmatically fail builds/deployments if route duration exceeds thresholds (e.g., Top::routes()->firstWhere('uri', '/api/checkout')->averageDuration > 1.5).Top::http(), Top::database(), etc., enabling product teams to monitor live service health without leaving the app.Top::startRecording(10) → run tests → Top::stopRecording() to capture and assert against metrics programmatically (e.g., ensure POST /api/upload stays under X ms).Top::track() equivalents for non-HTTP workloads.0.00 — restart top after traffic resumes, and expect brief spikes to vanish quickly due to short TTL.recording_mode matters: In development, set TOP_RECORDING_MODE=always in .env if using Top facade outside HTTP lifecycle (e.g., in queued jobs or test bootstraps); default "runtime" only captures during live requests.TOP_REDIS_CONNECTION). Verify no other tool is clearing laravel-top:* keys — the package handles cleanup automatically.TOP_RECORDING_MODE=runtime in prod to minimize overhead when not actively debugging.How can I help you explore Laravel packages today?