PHPackages                             tomlankhorst/hangouts-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. tomlankhorst/hangouts-chat

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

tomlankhorst/hangouts-chat
==========================

Notifications from Laravel to Google Hangouts Chat

1.0.0(5y ago)03MITPHPPHP &gt;=7.2

Since Nov 27Pushed 5y agoCompare

[ Source](https://github.com/tomlankhorst/hangouts-chat)[ Packagist](https://packagist.org/packages/tomlankhorst/hangouts-chat)[ Docs](https://github.com/tomlankhorst/hangouts-chat)[ RSS](/packages/tomlankhorst-hangouts-chat/feed)WikiDiscussions master Synced 2d ago

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

Google Hangouts Chat notification channel for Laravel
=====================================================

[](#google-hangouts-chat-notification-channel-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f462396ddeda98a0980b40d402943fc7b9772841af0f7b5dd9e69434ec80a79e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f6d6c616e6b686f7273742f68616e676f7574732d636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tomlankhorst/hangouts-chat)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/c3cd7c0c286ad1f77c7971a90826ddc14c2d3ff183f18d4251a766722f88d152/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f72656e616e77696c6c69616d2f68616e676f7574732d636861742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/renanwilliam/hangouts-chat)[![StyleCI](https://camo.githubusercontent.com/945a4b177d67bdb6420f39b6234677156de593a9921749e6c9e641b2e9b625ce/68747470733a2f2f7374796c6563692e696f2f7265706f732f3234393737383539342f736869656c64)](https://styleci.io/repos/249778594)[![SymfonyInsight](https://camo.githubusercontent.com/2196bb511bbfa43fd294a14270d9d650637e2ee9dd3d7fae537ec3d6b8af062f/68747470733a2f2f696e73696768742e73796d666f6e792e636f6d2f70726f6a656374732f30396638393630352d366263382d343966372d613030372d3237323735346631313064322f6d696e692e737667)](https://insight.symfony.com/projects/09f89605-6bc8-49f7-a007-272754f110d2)[![Quality Score](https://camo.githubusercontent.com/731204ed4d3fc42f3d39466490536897dda830ed5f7f461d307411f09fa09252/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f72656e616e77696c6c69616d2f68616e676f7574732d636861742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/renanwilliam/hangouts-chat)[![Code Coverage](https://camo.githubusercontent.com/fb8df3ca80f4d856c233a0e7f0600c850224071e79d67e52a8c0b10580061ca5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f72656e616e77696c6c69616d2f68616e676f7574732d636861742f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/renanwilliam/hangouts-chat/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/dbb73ada9642ae21047ca0f6b6245ae98e5d700164dda76c4d88d6fb23029959/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746f6d6c616e6b686f7273742f68616e676f7574732d636861742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tomlankhorst/hangouts-chat)

This package makes it easy to send notifications using [Google Hangouts Chat](https://gsuite.google.com/products/chat/) with Laravel 5.5+, 6.x and 7.x

Contents
--------

[](#contents)

- [Installation](#installation)
    - [Setting up the Google Hangouts Chat service](#setting-up-the-google-hangouts-chat-service)
- [Usage](#usage)
    - [Available Message methods](#available-message-methods)
- [Changelog](#changelog)
- [Testing](#testing)
- [Security](#security)
- [Contributing](#contributing)
- [Credits](#credits)
- [License](#license)

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

[](#installation)

Install this package with Composer:

```
composer require tomlankhorst/hangouts-chat
```

### Setting up the Google Hangouts Chat service

[](#setting-up-the-google-hangouts-chat-service)

In order to send messages using bots, you need to [setup a webhook for a room](https://developers.google.com/hangouts/chat/how-tos/webhooks#send_messages_to_the_chat_room).

Usage
-----

[](#usage)

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

```
use NotificationChannels\GoogleHangoutsChat\HangoutsChatChannel;
use NotificationChannels\GoogleHangoutsChat\HangoutsChatMessage;
use Illuminate\Notifications\Notification;

class ProjectCreated extends Notification
{
    public function via($notifiable)
    {
        return ['hangoutsChat'];
    }

    public function toHangoutsChat$notifiable)
    {
        return HangoutsChatMessage::create()
            ->data([
               'text' => 'It is a test message!'
            ]);
    }
}
```

Please look at [Hangouts Chat Message Formats](https://developers.google.com/hangouts/chat/reference/message-formats) to understand how send the messages.

In order to let your Notification know which URL should receive the Webhook data, add the `routeNotificationForHangoutsChat` method to your Notifiable model. This method needs to return the URL where the notification Webhook will receive a POST request.

```
public function routeNotificationForHangoutsChat()
{
    return 'https://chat.googleapis.com/v1/spaces/XXXXX-XXXXX/messages?key={key}&token={token}';
}
```

You can send to a dynamic Webhook URL on-fly using this syntax:

```
Notification::route('hangoutsChat', 'https://chat.googleapis.com/v1/spaces/XXXXX-XXXXX/messages?key={key}&token={token}')
                    ->notify(new NotificationClass($params));
```

### Available Message methods

[](#available-message-methods)

- `data('')`: Accepts a JSON-encodable value for the Webhook body.
- `query('')`: Accepts an associative array of query string values to add to the request.
- `userAgent('')`: Accepts a string value for the Webhook user agent.
- `header($name, $value)`: Sets additional headers to send with the POST Webhook.
- `verify()`: Enable the SSL certificate verification or provide the path to a CA bundle

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

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)

- [Renan William Alves de Paula](https://github.com/renanwilliam)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.8% 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

1992d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f72b9c1a481450b37bb3f8b1e97e64634d1b1fc2ceda19aee96cde4c40c2264?d=identicon)[tomlankhorst](/maintainers/tomlankhorst)

---

Top Contributors

[![renanwilliam](https://avatars.githubusercontent.com/u/19995615?v=4)](https://github.com/renanwilliam "renanwilliam (23 commits)")[![tomlankhorst](https://avatars.githubusercontent.com/u/675432?v=4)](https://github.com/tomlankhorst "tomlankhorst (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tomlankhorst-hangouts-chat/health.svg)

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

###  Alternatives

[laravel-notification-channels/telegram

Telegram Notifications Channel for Laravel

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

Web Push Notifications driver for Laravel.

7984.5M16](/packages/laravel-notification-channels-webpush)[laravel-notification-channels/fcm

FCM (Firebase Cloud Messaging) Notifications Driver for Laravel

5917.0M16](/packages/laravel-notification-channels-fcm)[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/twilio

Provides Twilio notification channel for Laravel

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

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)

PHPackages © 2026

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