PHPackages                             nghia-kun/laravel-chat-api - 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. nghia-kun/laravel-chat-api

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

nghia-kun/laravel-chat-api
==========================

Send messages to Google Chat via webhooks in Laravel

v1.0.0(1mo ago)02MITPHPPHP ^8.1

Since May 29Pushed 1mo agoCompare

[ Source](https://github.com/bhnghia1012/laravel-chat-api)[ Packagist](https://packagist.org/packages/nghia-kun/laravel-chat-api)[ Docs](https://github.com/bhnghia1012/laravel-chat-api)[ RSS](/packages/nghia-kun-laravel-chat-api/feed)WikiDiscussions main Synced 1w ago

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

Laravel Chat API - Google Chat Webhook
======================================

[](#laravel-chat-api---google-chat-webhook)

Send messages to Google Chat spaces directly from your Laravel application using incoming webhooks.

Requirements
------------

[](#requirements)

- PHP 8.1+
- Laravel 10 / 11 / 12

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

[](#installation)

```
composer require kun/laravel-chat-api
```

Laravel auto-discovers the service provider and facade automatically.

### Publish the config file (optional)

[](#publish-the-config-file-optional)

```
php artisan vendor:publish --tag=google-chat-config
```

Configuration
-------------

[](#configuration)

Add the webhook URL to your `.env` file:

```
GOOGLE_CHAT_WEBHOOK_URL=https://chat.googleapis.com/v1/spaces/XXXXX/messages?key=...&token=...
```

> **How to get the webhook URL:**Open your Google Chat space, click the space name, go to **Apps &amp; integrations** &gt; **Webhooks** &gt; **Add webhook**, then copy the generated URL.

Usage
-----

[](#usage)

### Using the Facade

[](#using-the-facade)

```
use Kun\LaravelChatApi\Facades\GoogleChat;

// Simple text message
GoogleChat::sendMessage('Hello from Laravel!');

// Card with title and body
GoogleChat::sendCard('Deploy finished', 'v2.5.0 was deployed to production successfully.');

// Alert / error notification
GoogleChat::sendAlert('Payment failed', 'Order #1234 could not be charged.', 'ERROR');
GoogleChat::sendAlert('Disk usage high', 'Server disk at 90%.', 'WARNING');
GoogleChat::sendAlert('Backup done', 'Nightly backup completed.', 'SUCCESS');
```

### Send to a different webhook at runtime

[](#send-to-a-different-webhook-at-runtime)

```
GoogleChat::to('https://chat.googleapis.com/v1/spaces/OTHER/messages?...')
    ->sendMessage('Message to a different space.');
```

### Using dependency injection

[](#using-dependency-injection)

```
use Kun\LaravelChatApi\GoogleChatService;

class OrderController extends Controller
{
    public function __construct(protected GoogleChatService $chat) {}

    public function store(Request $request)
    {
        // ... create order ...
        $this->chat->sendMessage("New order #{$order->id} received!");
    }
}
```

Available Methods
-----------------

[](#available-methods)

MethodDescription`sendMessage(string $message)`Send a plain text message (supports basic Markdown)`sendCard(string $title, string $body)`Send a card with a header and text body`sendAlert(string $title, string $message, string $level)`Send a prefixed alert: `ERROR`, `WARNING`, `INFO`, `SUCCESS``to(string $webhookUrl)`Override the webhook URL for one call (returns a cloned instance)License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance89

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

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

57d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/108937821?v=4)[bhnghia1012](/maintainers/bhnghia1012)[@bhnghia1012](https://github.com/bhnghia1012)

---

Top Contributors

[![bhnghia1012](https://avatars.githubusercontent.com/u/108937821?v=4)](https://github.com/bhnghia1012 "bhnghia1012 (3 commits)")

---

Tags

laravelnotificationwebhookGoogle-Chat

### Embed Badge

![Health badge](/badges/nghia-kun-laravel-chat-api/health.svg)

```
[![Health](https://phpackages.com/badges/nghia-kun-laravel-chat-api/health.svg)](https://phpackages.com/packages/nghia-kun-laravel-chat-api)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.3M347](/packages/psalm-plugin-laravel)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77922.3M186](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)

PHPackages © 2026

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