2017 © Pedro Peláez
 

library hipchat-api

Hipchat API written in PHP optimized for Laravel.

image

bestit/hipchat-api

Hipchat API written in PHP optimized for Laravel.

  • Tuesday, May 2, 2017
  • by WBLKonzept
  • Repository
  • 4 Watchers
  • 1 Stars
  • 75 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

bestit/hipchat-api

This a very simple HipChat API optimized for Laravel & Lumen version 5., (*1)

Installation

Install via Composer

From the command line, run:, (*2)

composer require bestit/hipchat-api

Laravel 5

Step 1: Publishing config

From the command line, run:, (*3)

php artisan vendor:publish --provider HipChatServiceProvider

Step 2: Service Provider

For your Laravel app, open config/app.php and, within the providers array, append:, (*4)

Bestit\HipChat\HipChatServiceProvider::class,

This will bootstrap the package into Laravel., (*5)

Step 3: Facade

For your Laravel app, open config/app.php and, within the aliases array, append:, (*6)

'HipChat' => Bestit\HipChat\Facade\HipChat::class,

This will add the HipChat Facade into Laravel., (*7)

Step 4: Configuration

Add the following entries to your environment (.env) file:, (*8)

HIPCHAT_SERVER_URL // This is optional, defaults to 'https://api.hipchat.com'
HIPCHAT_API_TOKEN // This is required, use a user personal token.

Lumen 5

Step 1: Service provider

Inside your bootstrap/app.php file, add:, (*9)

$app->register(Bestit\HipChat\HipChatLumenServiceProvider::class);

Step 2: Configuration

Copy the vendor/bestit/hipchat-api/src/config/hipchat.php file to your local config directory (if it does not exist yet, you have to create it) and don't forget add the entries to your environment (.env) file described in Step 4 of the Laravel Configuration., (*10)

Usage

  • Notification in a Room, (*11)

    HipChat::room('RoomNameOrRoomId')->notify('Some Cool Message');
    
    // you have three optional parameters, `color`, `alert` and `notify`
    

    Read more: here, (*12)

  • Notification to a user, (*13)

    HipChat::user('UserEmailOrId')->notify('Some Cool Message');
    
    // you have two optional parameters, `alert` and `format`
    

    Read more: here, (*14)

Usage outside of Laravel / Lumen

$url = 'https://company.hipchat.com'; // Can be left empty, default to https://api.hipchat.com
$token = 'some_api_token';
$client = new \Bestit\HipChat\Client($token, $url);

$client->room('RoomNameOrRoomId')->notify('Some Cool Message');

$client->user('UserEmailOrId')->notify('Some Cool Message');

Todo

  • Cover more API Endpoints
  • Tests
  • Cleanup/Interfaces etc.
  • Travis CI

The Versions

02/05 2017

0.1.0

0.1.0.0

Hipchat API written in PHP optimized for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ahmad El-Bardan

laravel hipchat

03/04 2017

dev-master

9999999-dev

Hipchat API written in PHP optimized for Laravel.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Ahmad El-Bardan

laravel hipchat