Hi everyone! I’ve just released Eloquent Guard, a production-ready monitor for Laravel that catches performance bottlenecks exactly where they happen.
🛡️ Why I built this
Standard Laravel logs often hide the real cause of performance drops. I wanted a tool that not only detects issues but tells you exactly which file and line triggered them, while ignoring the vendor/ noise.
✨ Key Features:
-N+1 Detection: Finds repeated queries within a single request automatically.
-Slow Query Monitor: Alerts you when a query exceeds your custom threshold.
-Smart Backtrace: Pinpoints the exact line of code in your routes or controllers.
-Multi-channel Reporting: Built-in support for Slack, Telegram, Sentry, and Logs.
-Pulse Integration: Includes a custom card for the Laravel Pulse dashboard to visualize trends.
🚀 Quick Example
It works out of the box. Once installed, you get alerts like this in your logs or Slack:
Eloquent Guard: N+1 detected! {"sql":"select * from users...","count":5,"source":"/routes/web.php:9"}
Eloquent Guard: Slow Query! {"sql":"SELECT SLEEP(1)","duration":"1000.47ms","source":"/var/www/html/routes/web.php:13"}
📊 Laravel Pulse Support
If you are using Laravel Pulse, you can add a dedicated card to see your alerts live:
<livewire:maxis.eloquent-guard cols="4" />
Links:
GitHub: https://github.com/Maxiz88/laravel-eloquent-guard
Packagist: https://packagist.org/packages/maxis/laravel-eloquent-guard
I'd love to hear your thoughts! Does this fit into your workflow, or are there any specific reporters (like Discord or Teams) you'd like to see added?
Thanks for checking it out!
Top comments (0)