mohamedsamy902/laravel-pulse-alert
Composer 安装命令:
composer require mohamedsamy902/laravel-pulse-alert
包简介
A zero-configuration Laravel package for real-time error monitoring, Telegram alerts, daily email reports, and suspicious traffic detection.
README 文档
README
Arabic Version (النسخة العربية)
Real-time error monitoring, intelligent alerts, and traffic surveillance for Laravel applications.
PulseAlert is a lightweight, zero-configuration package designed to keep you informed about your application's health. It goes beyond simple logging by classifying errors, sending instant Telegram notifications for critical issues, and providing daily summaries.
✨ Features
- Intelligent Priority Engine: Automatically classifies exceptions (CRITICAL, HIGH, MEDIUM, LOW).
- Telegram Instant Alerts: Receive 🔴 Critical and 🟠 High priority alerts directly on Telegram.
- Smart Rate Limiting: Prevents alert spam by silencing duplicate errors for 10 minutes.
- Traffic Surveillance: Middleware to detect and notify about suspicious request volume from single IPs.
- Daily Error Digest: Beautifully formatted email summaries sorted by importance.
- Data Sanitization: Automatically scrubs sensitive data (passwords, tokens) from stack traces.
🚀 Installation
Step 1 — Install via Composer
composer require mohamedsamy902/laravel-pulse-alert
Step 2 — Publish Config & Migrations
php artisan vendor:publish --tag=pulse-alert-config php artisan vendor:publish --tag=pulse-alert-migrations
Step 3 — Run Migrations
php artisan migrate
📋 Configuration
Environment Variables
Add these keys to your .env file:
| Variable | Description | Default |
|---|---|---|
PULSE_ALERT_TELEGRAM_TOKEN |
Your Telegram Bot Token (@BotFather) | null |
PULSE_ALERT_TELEGRAM_CHAT_ID |
Your Telegram Chat/Group ID | null |
PULSE_ALERT_TELEGRAM_ENABLED |
Toggle Telegram alerts | true |
PULSE_ALERT_TELEGRAM_QUEUE |
Set false for instant delivery without Worker |
false |
PULSE_ALERT_LOCALE |
Message language (en or ar) |
en |
PULSE_ALERT_MAIL_TO |
Recipient for daily reports | null |
PULSE_ALERT_MAIL_ENABLED |
Toggle email reports | true |
PULSE_ALERT_REPORT_TIME |
Departure time for daily report | 08:00 |
PULSE_ALERT_RATE_MAX |
Max requests allowed per window | 20 |
PULSE_ALERT_RATE_WINDOW |
Time window in minutes | 1 |
Registering the Logger (Laravel 11/12)
In your bootstrap/app.php, register the PulseAlert logger within the withExceptions block:
use MohamedSamy902\PulseAlert\Services\ErrorLogger; // ... ->withExceptions(function (Exceptions $exceptions) { app(ErrorLogger::class)->register($exceptions); })
Scheduling the Daily Report
In your routes/console.php, schedule the report to run daily:
use Illuminate\Support\Facades\Schedule; Schedule::command('pulse-alert:daily-report')->dailyAt('08:00');
📖 Usage
Automatic Traffic Surveillance
The package automatically registers its rate-limiting middleware globally. All requests (Web, API, Dashboard) are monitored by default using the settings in your config file.
Manual Logging
You can manually log errors with a specific priority if needed:
use MohamedSamy902\PulseAlert\Services\ErrorLogger; try { // ... code } catch (\Exception $e) { app(ErrorLogger::class)->log($e, 'CRITICAL'); }
🎯 Priority Classification Logic
- CRITICAL: Database errors, 500 status codes, or severe engine errors. (Instant Alert 🔴)
- HIGH: Keywords like "payment", "unauthorized", "auth", or "token" detected in message. (Instant Alert 🟠)
- MEDIUM: General exceptions that don't match critical/high criteria. (Daily Report only)
- LOW: Minor issues or manually logged low-priority events. (Daily Report only)
🧪 Testing
composer test
📄 License
The MIT License (MIT). Please see License File for more information.
mohamedsamy902/laravel-pulse-alert 适用场景与选型建议
mohamedsamy902/laravel-pulse-alert 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「logging」 「error」 「alerts」 「monitoring」 「laravel」 「pulse」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mohamedsamy902/laravel-pulse-alert 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mohamedsamy902/laravel-pulse-alert 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mohamedsamy902/laravel-pulse-alert 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Zend Framework module that sets up Monolog for logging in applications.
Asynchronous Sentry for Symfony - Fire and forget
Add visual alerts / warnings to Flarum posts
Laravel package for managing session messages and alerts in view responses
Stackdriver handler for Monolog (codeinternetapplications/monolog-stackdriver Fork).
High-performance, zero-dependency PSR-3 logger for MonkeysLegion with structured logging, handlers, processors, and PHP 8.4 features.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 39
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-17