PHPackages                             batistackapp/rocket-chat - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. batistackapp/rocket-chat

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

batistackapp/rocket-chat
========================

Rocket.Chat Notifications channel for Laravel 5.6+

1.0.0(6mo ago)01MITPHPPHP ^7.2.0|^8.0

Since Oct 25Pushed 6mo agoCompare

[ Source](https://github.com/BatistackApp/rocket-chat)[ Packagist](https://packagist.org/packages/batistackapp/rocket-chat)[ Docs](https://github.com/laravel-notification-channels/rocket-chat)[ RSS](/packages/batistackapp-rocket-chat/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Rocket.Chat Laravel Notifications Channel
=========================================

[](#rocketchat-laravel-notifications-channel)

[![cog-laravel-rocket-chat-notification-channel](https://user-images.githubusercontent.com/1849174/74969369-87649980-542d-11ea-9692-c6f7ba68e2bf.png)](https://user-images.githubusercontent.com/1849174/74969369-87649980-542d-11ea-9692-c6f7ba68e2bf.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/4dbc2a8de668345b3dacf25ef70a0460463b0a2d3774311b4c9f511d21a4a970/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f726f636b65742d636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/rocket-chat)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/01d0649eb1c9b93adf08b03a415f4a7b98e3fa7fdf6acee933e02666ac91cb9a/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f726f636b65742d636861742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/laravel-notification-channels/rocket-chat)[![StyleCI](https://camo.githubusercontent.com/e08f7307fea8975005e305cd7285e5b84ced6b6843ff1b24abaa65f39367166d/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234313832383531312f736869656c64)](https://styleci.io/repos/241828511)[![Quality Score](https://camo.githubusercontent.com/69fd26e25b85f0784acf4ade3fb3f12d1a2cabd95bf3d827a3dcee82231f1178/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f726f636b65742d636861742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/rocket-chat)[![Code Coverage](https://camo.githubusercontent.com/3a9700f4a1cac567261fb4f3156e9c0664fac6c8e143af9c55eceb30fecc9e27/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f726f636b65742d636861742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/laravel-notification-channels/rocket-chat/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/d95a67a785e5b8b9f215666809bbc2df58889fd63f3e9e3660343ed3f65b82f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2d6e6f74696669636174696f6e2d6368616e6e656c732f726f636b65742d636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/laravel-notification-channels/rocket-chat)

Introduction
------------

[](#introduction)

This package makes it easy to send notifications using [RocketChat](https://rocket.chat/) with Laravel 5.6+.

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the RocketChat service](#setting-up-the-rocketchat-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [Change log](#changelog)
- [License](#license)

Installation
------------

[](#installation)

You can install the package via composer:

```
$ composer require laravel-notification-channels/rocket-chat
```

### Setting up the RocketChat service

[](#setting-up-the-rocketchat-service)

In order to send message to RocketChat channels, you need to obtain [Webhook](https://rocket.chat/docs/administrator-guides/integrations#how-to-create-a-new-incoming-webhook).

Add your RocketChat API server's base url, incoming Webhook Token and optionally the default channel to your `config/services.php`:

```
// config/services.php
...
'rocketchat' => [
     // Base URL for RocketChat API server (https://your.rocketchat.server.com)
    'url' => env('ROCKETCHAT_URL'),
    'token' => env('ROCKETCHAT_TOKEN'),
    // Default channel (optional)
    'channel' => env('ROCKETCHAT_CHANNEL'),
],
...
```

Usage
-----

[](#usage)

You can use the channel in your `via()` method inside the notification:

```
use Illuminate\Notifications\Notification;
use NotificationChannels\RocketChat\RocketChatMessage;
use NotificationChannels\RocketChat\RocketChatWebhookChannel;

class TaskCompleted extends Notification
{
    public function via($notifiable): array
    {
        return [
            RocketChatWebhookChannel::class,
        ];
    }

    public function toRocketChat($notifiable): RocketChatMessage
    {
        return RocketChatMessage::create('Test message')
            ->to('channel_name') // optional if set in config
            ->from('webhook_token'); // optional if set in config
    }
}
```

In order to let your notification know which RocketChat channel you are targeting, add the `routeNotificationForRocketChat` method to your Notifiable model:

```
public function routeNotificationForRocketChat(): string
{
    return 'channel_name';
}
```

### Available methods

[](#available-methods)

`from()`: Sets the sender's access token.

`to()`: Specifies the channel id to send the notification to (overridden by `routeNotificationForRocketChat` if empty).

`content()`: Sets a content of the notification message. Supports Github flavoured markdown.

`alias()`: This will cause the message’s name to appear as the given alias, but your username will still display.

`emoji()`: This will make the avatar on this message be an emoji. (e.g. ':see\_no\_evil:')

`avatar()`: This will make the avatar use the provided image url.

`attachment()`: This will add an single attachment.

`attachments()`: This will add multiple attachments.

`clearAttachments()`: This will remove all attachments.

### Adding Attachment

[](#adding-attachment)

There are several ways to add one ore more attachments to a message

```
public function toRocketChat($notifiable)
{
    return RocketChatMessage::create('Test message')
        ->to('channel_name') // optional if set in config
        ->from('webhook_token') // optional if set in config
        ->attachments([
            RocketChatAttachment::create()->imageUrl('test'),
            RocketChatAttachment::create(['image_url' => 'test']),
            new RocketChatAttachment(['image_url' => 'test']),
            [
                'image_url' => 'test'
            ]
        ]);
}
```

#### Available methods

[](#available-methods-1)

`color()`: The color you want the order on the left side to be, any value background-css supports.

`text()`: The text to display for this attachment, it is different than the message’s text.

`timestamp()`: Displays the time next to the text portion. ISO8601 Zulu Date or instance of any `\DateTime`

`thumbnailUrl()`: An image that displays to the left of the text, looks better when this is relatively small.

`messageLink()`: Only applicable if the ts is provided, as it makes the time clickable to this link.

`collapsed()`: Causes the image, audio, and video sections to be hiding when collapsed is true.

`author($name, $link, $icon)`: shortcut for author methods

`authorName()`: Name of the author.

`authorLink()`: Providing this makes the author name clickable and points to this link.

`authorIcon()`: Displays a tiny icon to the left of the Author’s name.

`title()`: Title to display for this attachment, displays under the author.

`titleLink()`: Providing this makes the title clickable, pointing to this link.

`titleLinkDownload()`: When this is true, a download icon appears and clicking this saves the link to file.

`imageUrl()`: The image to display, will be “big” and easy to see.

`audioUrl()`: Audio file to play, only supports what html audio does.

`videoUrl()`: Video file to play, only supports what html video does.

`fields()`: An array of Attachment Field Objects.

```
[
    [
        'short' => false, // Whether this field should be a short field. Default: false
        'title' => 'Title 1', //The title of this field. Required
        'value' => 'Value 1' // The value of this field, displayed underneath the title value. Required
    ],
    [
        'short' => true,
        'title' => 'Title 2',
        'value' => 'Value 2'
    ],

];
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Testing
-------

[](#testing)

```
$ vendor/bin/phpunit
```

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Anton Komarev](https://komarev.com)
- [Nicholas](https://github.com/Funfare)
- [atymic](https://github.com/atymic)
- [All Contributors](../../contributors)

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

About CyberCog
--------------

[](#about-cybercog)

[CyberCog](https://cybercog.su) is a Social Unity of enthusiasts. Research best solutions in product &amp; software development is our passion.

[![cybercog-logo](https://cloud.githubusercontent.com/assets/1849174/18418932/e9edb390-7860-11e6-8a43-aa3fad524664.png)](https://cloud.githubusercontent.com/assets/1849174/18418932/e9edb390-7860-11e6-8a43-aa3fad524664.png)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance66

Regular maintenance activity

Popularity1

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

205d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2837bbbc36d8550567dadcfe1eaf3170ba56aa68debfb65082043799d55c5eee?d=identicon)[vortechstudio](/maintainers/vortechstudio)

---

Top Contributors

[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (21 commits)")[![atymic](https://avatars.githubusercontent.com/u/50683531?v=4)](https://github.com/atymic "atymic (5 commits)")[![Funfare](https://avatars.githubusercontent.com/u/13119997?v=4)](https://github.com/Funfare "Funfare (3 commits)")[![vortechstudio](https://avatars.githubusercontent.com/u/155325740?v=4)](https://github.com/vortechstudio "vortechstudio (2 commits)")[![Krishan19](https://avatars.githubusercontent.com/u/1979578?v=4)](https://github.com/Krishan19 "Krishan19 (1 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (1 commits)")

---

Tags

laravelnotificationschatrocketchatnotification-channel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/batistackapp-rocket-chat/health.svg)

```
[![Health](https://phpackages.com/badges/batistackapp-rocket-chat/health.svg)](https://phpackages.com/packages/batistackapp-rocket-chat)
```

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

1.1k3.4M35](/packages/laravel-notification-channels-telegram)[laravel-notification-channels/discord

Laravel notification driver for Discord.

2371.3M11](/packages/laravel-notification-channels-discord)[s-ichikawa/laravel-sendgrid-driver

This library adds a 'sendgrid' mail driver to Laravel.

4139.3M1](/packages/s-ichikawa-laravel-sendgrid-driver)[laravel-notification-channels/rocket-chat

Rocket.Chat Notifications channel for Laravel 5.6+

1345.5k](/packages/laravel-notification-channels-rocket-chat)[laravel-notification-channels/twilio

Provides Twilio notification channel for Laravel

2587.7M12](/packages/laravel-notification-channels-twilio)[benwilkins/laravel-fcm-notification

Laravel FCM (Firebase Cloud Messaging) Notification Channel

210964.1k1](/packages/benwilkins-laravel-fcm-notification)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
