Weave Code
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 bridge for Rocket.Chat. Configure a rocketchat:// DSN with incoming webhook token and default channel, then send ChatMessages. Supports custom payload (alias/avatar/channel overrides) and multiple attachments for rich messages.

View on GitHub
Deep Wiki
Context7

Symfony RocketChat Notifier Bridge

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.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor