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
Rocket Chat Notifier

Rocket Chat Notifier Laravel Package

symfony/rocket-chat-notifier

Symfony Notifier integration for Rocket.Chat. Configure a webhook DSN with access token and channel, then send ChatMessages with custom payloads and attachments to control bot name, avatar, channel, and message content.

View on GitHub
Deep Wiki
Context7

RocketChat Notifier provides Rocket.Chat integration for Symfony Notifier, letting you post messages to a channel through an incoming webhook. Configure it with a simple DSN containing your webhook access token and target channel, which can be overridden per message.

  • DSN configuration via rocketchat://ACCESS_TOKEN@default?channel=CHANNEL
  • Multiple attachments with colors, titles, and text
  • Custom payloads processed by a Rocket.Chat webhook script
  • Bot customization using alias, emoji, and avatar
  • Channel override directly in the message payload
Frequently asked questions about Rocket Chat Notifier
How do I install and configure this package in Laravel?
Run `composer require symfony/rocket-chat-notifier`, then configure it via a DSN string in your `.env` (e.g., `ROCKETCHAT_DSN=rocketchat://TOKEN%2FCHANNEL@your-rocketchat-host`). Laravel’s config system can map this to a `rocket_chat.php` file for easier access. Ensure your RocketChat webhook is set up first.
Does this package work with Laravel’s default Guzzle HTTP client?
Yes, but it primarily relies on Symfony’s HTTP client. If you prefer Guzzle, wrap the package’s HTTP client in a Guzzle-compatible adapter or use Laravel’s HTTP client facade to bridge the gap. The package’s core functionality remains the same.
What Laravel versions are officially supported?
The package targets Symfony 7+, which aligns best with Laravel 10+. Laravel 9.x may work but could require polyfills for Symfony 7 dependencies. For Laravel 8 or older, integration may need significant refactoring due to Symfony component version mismatches.
Can I send custom payloads or attachments with messages?
Yes, use the `RocketChatOptions` class to override defaults like bot alias, avatar, or channel. Attachments support rich formatting (e.g., colors, titles, text) and multiple attachments. The payload is processed by a Rocket.Chat Incoming Webhook Script, giving you full control over message structure.
How do I handle API errors or rate limits in production?
The package lacks built-in retry logic, so wrap calls in Laravel’s queue system or use middleware to handle retries and errors. For rate limits, implement exponential backoff in your queue jobs or use Laravel’s `retry-after` logic.
Is there support for real-time updates or WebSocket interactions?
No, this package focuses on HTTP-based notifications via webhooks. For real-time features (e.g., live chat), you’ll need to integrate RocketChat’s WebSocket API separately, likely using a custom Laravel service or a dedicated package.
Can I trigger RocketChat messages from Laravel events or queues?
Absolutely. Inject the notifier into Laravel’s service container and bind it to events (e.g., `OrderShipped`). For queues, dispatch a job that uses the notifier to send messages asynchronously, improving performance for high-volume notifications.
What authentication methods does this package support?
The package defaults to webhook tokens (via DSN) but can be extended for API keys or OAuth. Store credentials securely in Laravel’s `.env` or a secrets manager. Ensure your RocketChat instance is configured to accept the chosen authentication method.
Are there PHPUnit tests for this package? How can I test it in Laravel?
The package includes tests for core functionality, but you’ll need to write integration tests in Laravel to verify DSN parsing, payload formatting, and error handling. Mock the HTTP client or use Laravel’s HTTP tests to simulate RocketChat responses.
What alternatives exist if I don’t want to use this package?
For lightweight needs, use Guzzle directly to call RocketChat’s API. For other platforms, Laravel’s native Slack or Teams notifiers are simpler. If RocketChat isn’t critical, consider Pusher for real-time features or Laravel’s built-in notifications for email/SMS.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource