How I Built a Laravel Package to Send Error Alerts to Telegram, Slack & Discord
Abdullah Alhumsi developed a Laravel package called laravel-error-notifier to automatically send error alerts to Telegram, Slack, and Discord when exceptions occur in production. The package is designed to be simple to install, with auto-discovery and configurable alert routing based on severity. It provides actionable, formatted alerts with suggested fixes, aiming to help developers respond quickly to issues.
- ▪The laravel-error-notifier package integrates with Laravel's exception handler to send real-time error alerts.
- ▪Alerts are formatted for each platform using MarkdownV2 for Telegram, Block Kit for Slack, and embeds for Discord.
- ▪Users can configure which channels receive alerts based on severity levels such as emergency, critical, or error.
- ▪The package supports custom analyzers, formatters, and notifiers through interfaces, allowing for extensibility.
- ▪Installation requires adding environment variables for service credentials and is simplified by Laravel's auto-discovery feature.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3907687) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Abdullah Alhumsi Posted on May 1 How I Built a Laravel Package to Send Error Alerts to Telegram, Slack & Discord #laravel #php #opensource #webdev Every Laravel app breaks in production. The question is: do you find out before your users do? I got tired of checking logs manually and built a package that sends instant, actionable error alerts to Telegram, Slack, and Discord the moment something breaks. Here's how I built it and what I learned.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).