artdarek / pusherer by artdarek

Pusher.com service provider for Laravel 4.
86,602
48
2
Package Data
Maintainer Username: artdarek
Maintainer Contact: artdarek@gmail.com (Artdarek)
Package Create Date: 2013-06-27
Package Last Update: 2015-11-04
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-02-15 15:08:41
Package Statistics
Total Downloads: 86,602
Monthly Downloads: 108
Daily Downloads: 16
Total Stars: 48
Total Watchers: 2
Total Forks: 14
Total Open Issues: 6

Pusherer - Laravel 4 Service Provider

Pusherer is a simple Pusher.com service provider for Laravel 4. Pusher (Documentation) is a simple hosted API for adding realtime bi-directional functionality via WebSockets to web and mobile apps, or any other Internet connected device.


Installation

Add Pusherer to your composer.json file:

"require": {
	"artdarek/pusherer": "1.0.*"
}

Use composer to install this package.

$ composer update

Registering the Package

Add the Pusherer Service Provider to your config in app/config/app.php:

'providers' => array(
	'Artdarek\Pusherer\PushererServiceProvider'
),

Configuration

Run on the command line from the root of your project:

$ php artisan config:publish artdarek/pusherer

Set your pusher.com credentials in app/config/packages/artdarek/pusherer/config.php

return array( 

	/**
	 * App id
	 */
	'app_id' => '', 

	/**
	 * App key
	 */
	'key' => '',

	/**
	 * App Secret
	 */
	'secret' => ''	

);

If you have not a Pusher account, just sign up to get your API key, App Id and Secret.

Usage

/**
 * Add notification
 *
 * @return Void
 */
public function index() {

	// Send notification to Pusher
	$message = "This is just an example message!";
	Pusherer::trigger('my-channel', 'my-event', array( 'message' => $message ));
	
}