qwince/hipchat-laravel

HipChat PHP Client for Laravel 5

2.0.1 2016-03-21 19:02 UTC

This package is not auto-updated.

Last update: 2024-12-16 13:33:18 UTC


README

This a HipChat PHP Client for Laravel 5

Installation

  • Include "qwince/hipchat-laravel" inside the "require" section of composer.json file:

        ...
        "require": {
            ...,
            "qwince/hipchat-laravel": "dev-master"
        }
        ...
  • Update composer dependencies by running:

    composer update
    
  • Insert 'Qwince\HipchatLaravel\HipchatLaravelServiceProvider', in your 'providers' array, inside app/config/app.php:

    ...
    'providers' => [
        ...
        Qwince\HipchatLaravel\HipchatLaravelServiceProvider::class,
    ],
  • Insert 'HipChat' => Qwince\HipchatLaravel\Facade\HipChat:class, in your 'aliases' array, inside app/config/app.php:

    ...
    'aliases' => [
        ...
        'HipChat'         => Qwince\HipchatLaravel\Facade\HipChat::class,
    ],
  • To Publish the configuration files you will need, run:

    php artisan vendor:publish --provider="Qwince\HipchatLaravel\HipchatLaravelServiceProvider"
    
  • Edit app/config/hipchat.php file updating it your credentials / configurations:

    'server' => 'insert_your_url',
    'api_token' => 'insert_your_api_token',
    'app_name' => 'Your App Name',
    'default_room' => 1234,

Usage

  • Notify in a Room

    HipChat::setRoom('RoomID'); // or set default in config file 
    
    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);