qwince / hipchat-laravel by spitalia
forked from hernandev/hipchat-laravel

HipChat PHP Client for Laravel 5
11
1
5
Package Data
Maintainer Username: spitalia
Maintainer Contact: stefano@qwince.com (Stefano Todaro)
Package Create Date: 2016-07-28
Package Last Update: 2016-07-28
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-05-09 03:00:43
Package Statistics
Total Downloads: 11
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 1
Total Watchers: 5
Total Forks: 1
Total Open Issues: 0

qwince/hipchat-laravel

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);