lorapok/laravel-execution-monitor
最新稳定版本:v1.3.10
Composer 安装命令:
composer require lorapok/laravel-execution-monitor
包简介
Zero-configuration performance monitoring for Laravel applications with real-time alerts and beautiful UI
README 文档
README
Zero-configuration performance monitoring for Laravel applications
#MaJHiBhai - Your friendly Laravel performance companion 🐛
Explore Documentation • View Changelog • Download
✨ Features
Core Monitoring
- 🎯 Zero Configuration - Works out of the box with sensible defaults
- 🤖 Smart Auto-Detection - Automatically enables in dev/local/staging, disables in production
- 🎨 Beautiful Floating Widget - Real-time metrics in a sleek, animated UI with dev profile
- ⚡ Performance Tracking - Routes, queries, functions, memory usage, timers
- 📊 Real-Time Dashboard - Interactive modal with tabs for overview, routes, and queries
- 💾 Memory Profiling - Current and peak memory usage tracking
- ⏱️ Execution Timing - Precise request execution and function timing measurements
Query Management
- 📋 Clipboard Integration - Copy queries with one click from the widget
- ⌨️ Keyboard Shortcuts - Press
Ctrl+Shift+C(orCmd+Shift+Con Mac) to copy selected query - 🗂️ Clipboard History - Automatic storage of last 20 copied queries in browser localStorage
- 🔍 Query Selection - Click to select queries with visual highlighting
- ⏱️ Query Timing - See execution time for each database query
CLI Tools & Auditing
- 📋 Performance Audit -
php artisan monitor:auditfor security and performance health checks - 🔥 Heatmap Visualization -
php artisan monitor:heatmapto see which routes are consistently slow - 🏆 Achievement System - Earn badges for performance optimizations (Memory Master, Query Slayer)
- 📊 Status Check - Quick view of monitoring state and environment
Changelog
v1.3.6 (2026-01-10)
- ✅ UI/UX: Premium Optimization Quests redesign with glassmorphism and animated decorative larvae (🦋).
- ✅ Settings: Fully restored SMTP configuration fields for granular email notification control.
- ✅ Logs: Centered navigation tabs and middle-aligned controls for a standard professional layout.
- ✅ Stability: Fixed Alpine.js
undefinederrors and stabilized monitor modal positioning.
v1.3.0 (2026-01-10)
- ✅ UI/UX: Unique, professional identities for header action buttons (Quests, Dev, Settings).
- ✅ CI/CD Fix: Resolved
BindingResolutionExceptionand workflow path drift in GitHub Actions. - ✅ Navigation: Quests integrated into the top header for a cleaner main layout.
- ✅ Navigation: Added floating Home button to all test lab pages for easier navigation.
- ✅ System Info: Added PHP and Database (driver + version) information to monitor footer.
- ✅ Timeline Complete: Added missing
queriesandcontrollersegments to Larvae Trail. - ✅ Fixed N/A Data: Updated middleware to ensure request metrics (method, path, status) are captured.
- ✅ Isolation: Added timeline reset to prevent data pollution between requests.
v1.2.4 (2026-01-09)
- ✅ UI Fix: Resolved
[object Object]rendering in performance alerts modal. - ✅ CI/CD: Improved reliability of automated builds.
v1.2.0 (2026-01-09)
- 🚀 Major Refactoring: PSR-4 compliant structure (Reporters/Services)
- 🏆 Achievement System: Persistent performance milestones
- 🔥 Performance Heatmap: New
monitor:heatmapvisualization - 🔒 Security Audit: New
monitor:auditcommand - ✅ Bug Fixes: Class loading, Dashboard sync, UI feedback
v1.1.1 (2026-01-09)
v1.1.0 (2026-01-08)
- ✅ Enhanced Developer Profile with photo
- ✅ Redesigned Settings Modal
- ✅ Professional marketing assets integrated
v1.0.0 (2026-01-06)
- ✅ Initial release with core monitoring features
- ✅ Query tracking and history
- ✅ Multi-channel notifications
📦 Installation
composer require lorapok/laravel-execution-monitor
🔔 Discord integration
To enable Discord notifications, add the following to your application's .env (or set via your deployment configuration):
MONITOR_DISCORD_WEBHOOK=https://discordapp.com/api/webhooks/your_webhook_id/your_webhook_token
MONITOR_DISCORD_ENABLED=true
For local development you can also open the Lorapok widget and save a local developer webhook under Settings (stored in browser localStorage) — this is intended for developer convenience only. For production, prefer the .env approach.
To test sending an on-demand alert from the application, run:
php tools/trigger_discord_test.php
A GitHub Actions workflow is provided at .github/workflows/phpunit.yml that runs composer install and phpunit on push and pull requests.
That's it! The package automatically enables in local/dev/staging and disables in production.
Optional: Full Installation
php artisan monitor:install
🚀 Quick Start
use Lorapok\ExecutionMonitor\Facades\Monitor; // Track execution time Monitor::start('expensive-operation'); // ... your code Monitor::end('expensive-operation'); // Or use a closure $result = monitor('api-call', function() { return Http::get('https://api.example.com/data'); });
🎨 The Widget
A beautiful floating button appears in your application. Click it to see:
- 📊 Overview - Performance metrics at a glance
- 🛣️ Routes - All tracked routes with execution times
- 🗄️ Queries - Database queries with timing and copy-to-clipboard
- ⚡ Functions - Custom tracked functions
- 💾 Memory - Memory usage statistics
Clipboard Features
- Click Copy Button - Each query has a copy button; click to copy SQL to clipboard and see "Copied!" feedback
- Keyboard Shortcut - Press Ctrl+Shift+C (or Cmd+Shift+C on Mac) to copy the selected query (or first if none selected)
- Clipboard History - All copied queries are stored in browser localStorage (max 20 entries) for easy access
🖼️ Gallery
Core Monitoring Dashboard
Real-Time Overview![]() |
Timeline Visualization![]() |
Routes Analysis![]() |
Query Intelligence![]() |
Middleware Stack![]() |
Cache ROI![]() |
Log Viewer![]() |
Activity Monitor![]() |
Developer Productivity
Developer Profile (#MaJHiBhai)![]() |
In-Browser Terminal![]() |
API Playground![]() |
Usage Guide![]() |
Optimization Quests![]() |
Settings & Configuration
Advanced Config![]() |
|
Alert Thresholds![]() |
Email Notifications![]() |
Discord Integration![]() |
Slack Integration![]() |
Brand Assets
Larvae Mascot![]() |
📊 Check Status
# Check if monitoring is active php artisan monitor:status # Force enable php artisan monitor:enable # Disable monitoring php artisan monitor:disable
⚙️ Configuration
Publish config (optional):
php artisan vendor:publish --tag=lorapok-config
Edit config/execution-monitor.php:
return [ 'auto_detect' => true, // Smart environment detection 'features' => [ 'widget' => true, 'routes' => true, 'queries' => true, 'functions' => true, ], 'thresholds' => [ 'route' => 1000, // ms 'query' => 100, // ms ], ];
🎭 Environment Modes
| Mode | Local | Staging | Production |
|---|---|---|---|
local-only (default) |
✅ | ❌ | ❌ |
non-production |
✅ | ✅ | ❌ |
custom |
Config | Config | Config |
📢 Broadcasting & Real-Time Alerts
Lorapok integrates with Laravel Broadcasting to send real-time performance alerts to your team:
# Configure Pusher in .env BROADCAST_DRIVER=pusher PUSHER_APP_ID=your_app_id PUSHER_APP_KEY=your_app_key PUSHER_APP_SECRET=your_secret PUSHER_APP_CLUSTER=ap2
When thresholds are exceeded, performance alerts are:
- 📬 Broadcast to all connected clients in real-time
- 🔔 Sent to configured notification channels (Slack, Discord, Email)
- 💾 Optionally stored in database for audit trail
🎤 Notifications
Configure multiple notification channels in config/execution-monitor.php:
'notifications' => [ 'slack' => [ 'enabled' => true, 'webhook_url' => env('MONITOR_SLACK_WEBHOOK'), 'channel' => '#monitoring', ], 'discord' => [ 'enabled' => true, 'webhook_url' => env('MONITOR_DISCORD_WEBHOOK'), ], 'mail' => [ 'enabled' => true, 'to' => env('MONITOR_MAIL_TO', 'admin@example.com'), ], ], 'rate_limiting' => [ 'enabled' => true, 'max_per_hour' => 10, ],
📚 Advanced Usage
In Controllers
use Lorapok\ExecutionMonitor\Traits\TracksExecutionTime; class UserController extends Controller { use TracksExecutionTime; public function index() { $this->startTimer('user-fetch'); $users = User::paginate(20); $this->endTimer('user-fetch'); return view('users.index', compact('users')); } }
Helper Functions
// Quick tracking monitor()->start('task'); // ... monitor()->end('task'); // With closure $data = monitor('fetch-data', fn() => $this->getData()); // Check if enabled if (execution_monitor_enabled()) { // monitoring code }
🤝 Contributing
Contributions welcome! Please see CONTRIBUTING.md.
📄 License
MIT License - see LICENSE file.
🐛 About Lorapok
Lorapok (inspired by Black Soldier Fly Larvae) is a lightweight, zero-config performance monitoring package for Laravel. Like its namesake insect, Lorapok works quietly in the background to identify and eliminate performance bottlenecks, helping your Laravel application become more efficient and fast.
Lorapok makes it easy for developers to:
- 🔍 Identify slow queries and routes
- 📊 Monitor memory usage in real-time
- 🚨 Set up automatic performance alerts
- 📋 Copy and analyze database queries
- 🏃 Track custom code execution
👨💻 About the Creator
Mohammad Maizied Hasan Majumder
#MaJHiBhai - Making Laravel Fast! ⚡
🕒 Recent Activity
Last updated on: 2026-01-09 - Finalized stable release v1.2.8 🚀
Lorapok is developed and maintained by Mohammad Maizied Hasan Majumder
📧 Email: mdshuvo40@gmail.com 🔗 LinkedIn: linkedin.com/in/maizied 🐙 GitHub: @Maijied
Made with ❤️ for the Laravel community by @Maijied
lorapok/laravel-execution-monitor 适用场景与选型建议
lorapok/laravel-execution-monitor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 01 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「performance」 「debugging」 「monitoring」 「profiler」 「laravel」 「query-monitor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 lorapok/laravel-execution-monitor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 lorapok/laravel-execution-monitor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 lorapok/laravel-execution-monitor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
g4 application profiler package
CSS/Javascript Minificator, Compressor and Concatenator for TYPO3 - highly configurable frontend asset optimization for CSS/JS merging, minification and compression with optional body parsing, async/defer loading, inline output, data-ignore exclusions, SRI integrity validation/calculation, external
A Symfony bundle for chameleon-system/sanitycheck
WordPress mu-plugin to remove jQuery Migrate from the list of jQuery dependencies and to allow jQuery to enqueue before </body> instead of in the <head>.
Create link to static resources with cache-breaking segment based on md5 of the file
A PHP package that takes a snapshot of your application and allows you to retrieve it later to help with debugging.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-09




















