PHP code example of hernandev / hipchat-laravel

1. Go to this page and download the library: Download hernandev/hipchat-laravel 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/ */

    

hernandev / hipchat-laravel example snippets


        ...
        "         "hernandev/hipchat-laravel": "~2.0"
        }
        ...
    
    

    ...
    'providers' => [
        ...
        Hernandev\HipchatLaravel\HipchatLaravelServiceProvider::class,
    ],
    

    ...
    'aliases' => [
        ...
        'HipChat'         => Hernandev\HipchatLaravel\Facade\HipChat::class,
    ],
    

    'api_token' => 'insert_your_api_token',
    'app_name' => 'Your App Name',
    'default_room' => null, // this is optional
    
    

    HipChat::setRoom('RoomName');
    HipChat::sendMessage('My Message');
    
    // you have two optional parameters, `color` and `notify`
    // the 'red' will set the message color, and the third parameter when `true` notify all users on the room
    
    HipChat::sendMessage('My Message', 'red', true);
    
    
    
    

    HipChat::setRoom('RoomName');
    HipChat::getRoom(); // StdObject
    

    HipChat::setRoom('RoomName');
    HipChat::roomExists(); // boolean
    

    HipChat::getRooms(); // json
    

    HipChat::setRoom('RoomName');
    return HipChat::getRoomsHistory(); // json
    

    HipChat::setRoom('RoomName');
    return HipChat::setRoomTopic('New Topic via API'); // boolean
    

    HipChat::getUsers(); // json
    

    HipChat::setUser('[email protected]'); // you can use id, email or @mention_name
    HipChat::getUser(); // StdObject
    

    HipChat::setUser('[email protected]'); // you can use id, email or @mention_name
    // see optional fields on code
    HipChat::createRoom('New Room Name'); // boolean
    

    HipChat::getUsers(); // json
    

    HipChat::setRoom('RoomName');
    HipChat::deleteRoom(); // boolean
    

    // email, first_name last_name, mention_name, title
    HipChat::createUser('[email protected]', 'First Last', 'mention', 'title'); // boolean
    
 
     // you can use email, mention name or user_id
    HipChat::setUser('[email protected]');
    
    // same signature as create_user method, pass null the fields you dont want to update
    HipChat::updateUser(null, 'NewFirst New Last'); // boolean
    
    

    php artisan vendor:publish --tag=laravel