Laravel Google Chat Alerts


February 10th, 2022


Laravel Google Chat Alerts is a package by Guy Warner to send a message to Google chat quickly. Inspired by Spatie's Laravel Slack Alerts Package, this package does the same for Google Chat:

1use GuyWarner\GoogleChatAlerts\Facades\GoogleChatAlert;
4 "You have a new subscriber to the {$newsletter->name} newsletter!"

With the above code, you can send a message quickly without the overhead of the (excellent) Laravel notifications system. This package sends alerts as a job to prevent your app from failing in case Google chat is down.

Like the Spatie package for Slack, this package supports multiple channels and the ability to select which channel to which to send an alert:

1// in config/google-chat-alerts.php
3'webhook_urls' => [
4 'default' => '',
5 'sales' => '',
9 ->message("You have a new subscriber to the {$newsletter->name} newsletter!");

Additional features include using markdown and the ability to mention all users in a channel:

1GoogleChatAlert::message("New support ticket. <users/all>");

Check out this fantastic package on GitHub at guywarner/laravel-google-chat-alerts, which includes documentation, installation, and usage instructions.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.

Laravel News Partners