PHP code example of t0date / php-google-chat-v2

1. Go to this page and download the library: Download t0date/php-google-chat-v2 library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

t0date / php-google-chat-v2 example snippets




0date\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')
);