Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Discord Alerts

Laravel Discord Alerts Laravel Package

spatie/laravel-discord-alerts

Quickly send alerts to Discord from your Laravel app using a simple facade. Messages are dispatched via a queued job, so your app keeps running even if Discord is down. Just set a webhook URL and start notifying yourself of noteworthy events.

View on GitHub
Deep Wiki
Context7

Send a message to Discord

Frequently asked questions about Laravel Discord Alerts
How do I install spatie/laravel-discord-alerts in Laravel?
Run composer require spatie/laravel-discord-alerts, set DISCORD_ALERT_WEBHOOK to a valid Discord webhook URL, and optionally publish the config if you need to customize queue or webhook settings. Then import Spatie\DiscordAlerts\Facades\DiscordAlert and call DiscordAlert::message() from your application code. Clear Laravel's config cache after changing environment values. Ensure a queue worker is running because the actual Discord request is sent from a queued job.
How do I configure DISCORD_ALERT_WEBHOOK for Laravel Discord alerts?
Create a webhook in Discord and put its URL in your .env as DISCORD_ALERT_WEBHOOK. Treat that URL as a secret and keep it out of version control. If you publish the package config, confirm the webhook value maps to the environment variable and clear config cache after changes. For multiple channels, use named or ad-hoc webhooks as supported by the package.
Does spatie/laravel-discord-alerts support Laravel 12 and Laravel 13?
The changelog noted in the technical evaluation shows support for Laravel 12 and Laravel 13 on PHP 8.3, while older Laravel versions have been dropped over time. Always check the current Composer constraints on Packagist before upgrading. Pin the package version and run your test suite after Laravel or PHP upgrades. If you are on an older Laravel release, you may need an older package version.
Is DiscordAlert::message() queued, and what happens if Discord is down?
Yes. Under the hood the facade dispatches a job that posts to your Discord webhook, so the request path is not blocked by Discord latency or an outage. If Discord returns an error, your application request can still succeed, but alert delivery is best effort unless you add retry or monitoring. Avoid the sync queue driver in production because it removes that failure isolation. Make sure your queue worker is running and monitored.
Can I send Laravel Discord alerts to multiple channels or webhooks?
The package supports multiple named or ad-hoc webhooks in addition to a default webhook, so you can route different alert types to different Discord channels. Centralize routing in a small wrapper service so channel names and webhook configuration do not sprawl across the codebase. Each webhook URL is a credential, so store and rotate them as secrets. Confirm the exact configuration keys against the package README for your installed version.
Can I send Discord embeds, attachments, and custom usernames with laravel-discord-alerts?
The package supports embeds, attachments via file path or raw data, and username, avatar, and TTS overrides, according to the technical evaluation. For queued attachment-by-path sends, the file must still exist when the job runs, so use attachData() when workers do not share a filesystem. Keep Discord's message, embed, file-count, and 8 MB attachment limits in mind. Formatting and limits should be validated in a sandbox channel.
How do I test spatie/laravel-discord-alerts without sending real Discord messages?
Use a dedicated sandbox Discord channel and a test webhook rather than a production channel. In automated tests, use Laravel's Queue::fake() to assert that the alert job was dispatched, and use a controlled integration test if you need to verify the actual HTTP payload. Because the package sends through a queued job, check both dispatch behavior and job execution. Never commit or reuse production webhook URLs in tests.
What Discord rate limits and message limits affect laravel-discord-alerts?
Discord webhooks can be rate-limited and can return 4xx or 5xx responses, and Discord imposes limits on message size, embeds, file count, and attachments up to 8 MB. The package provides a thin POST to a webhook, so you should handle rate-limit responses and failed jobs in your queue monitoring. If you need delivery guarantees, add retry and backoff behavior by extending the configured job. Keep alert payloads concise and avoid sending large files through Discord.
How do I handle failed Discord alert jobs in Laravel?
Monitor your queue worker and failed_jobs table, because a Discord outage or revoked webhook can cause jobs to fail silently from the user's perspective. The default retry and backoff behavior may not be enough for critical alerts, so extend the configured job or wrap the facade with your own retry policy. Add fallback channels such as email, Slack, or your observability stack for alerts that must not be lost. Treat Discord as a convenience notification channel, not the only system of record.
Is spatie/laravel-discord-alerts a good alternative to Slack alerts or PagerDuty?
It is a good fit for one-way operational and product alerts inside a Laravel app, such as deploy notices, failed job summaries, signup milestones, and support escalations. It is not a Discord bot framework and does not provide inbound events, slash commands, or OAuth bot identity. If you already use Slack or PagerDuty for primary incidents, position Discord as a secondary or community channel. For business-critical delivery, add monitoring and fallback rather than relying on best-effort webhooks alone.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log
hsluv/hsluv
seampact/codegen
seampact/hooks
seampact/ir
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk