t0date / php-google-chat-v2
PHP library for sending messages to Google Chat via incoming webhook
0.1.0
2026-02-14 10:03 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-03-14 11:30:14 UTC
README
A PHP library template for Google Chat Incoming Webhooks.
Requirements
- Docker
- Docker Compose
Development Workflow
- Install dependencies
make setup
- Run tests
make test
- Run static analysis and coding style checks
make lint
- Apply formatting fixes (when needed)
make fix
Common Commands
make setup:composer installmake test: Run PHPUnitmake stan: Run PHPStanmake cs: Run PHP-CS-Fixer in dry-run modemake lint:test + stan + csmake fix: Apply PHP-CS-Fixer fixesmake example FILE=simple_text_message: Run any script underexamples/
Usage
<?php require __DIR__ . '/vendor/autoload.php'; use T0date\GoogleChat\GoogleChatSender; use T0date\GoogleChat\Message; $sender = new GoogleChatSender(); $sender->send( 'https://chat.googleapis.com/v1/spaces/xxx/messages?key=xxx&token=xxx', (new Message())->setText('Hello from php-google-chat-v2') );
Notes
DecoratedText.iconis deprecated in Google Chat Cards v2. This library intentionally does not implement it.