ramonvic / l4-pusher by ramonvic

Pusher.com service provider for Laravel 4, ith all settings configurable
808
0
1
Package Data
Maintainer Username: ramonvic
Maintainer Contact: ramonvic@me.com (Ramon Vicente)
Package Create Date: 2015-10-01
Package Last Update: 2015-10-02
Language: PHP
License: MIT
Last Refreshed: 2024-04-25 15:16:42
Package Statistics
Total Downloads: 808
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

L4Pusher - Laravel 4 Bridge for official pusher

Build Status Latest Version License

L4Pusher is a Pusher bridge for Laravel 4 using the official Pusher package.

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.


// Triggering events.
Pusher::trigger('my-channel', 'my_event', 'hello world');

// Get active channels
Pusher::get('/channels');

Installation

Require this package, with Composer, in the root directory of your project.

composer require ramonvic/l4-pusher

Add the service provider to config/app.php in the providers array.

'Ramonvic\L4Pusher\PusherServiceProvider'

If you want you can use the facade. Add the reference in config/app.php to your aliases array.

'L4Pusher' => 'Ramonvic\L4Pusher\Facades\Pusher'

Looking for a Laravel 5 compatible version?

Please use @vinkla's Laravel Pusher package instead.

Configuration

L4Pusher requires configuration. To get started, you'll need to publish all vendor assets:

php artisan config:publish ramonvic/l4-pusher

This will create a config/packages/ramonvic/l4-pusher/config.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

Usage

Here you can see an example of just how simple this package is to use. Out of the box, the default adapter is main. After you enter your authentication details in the config file, it will just work:

// You can alias this in config/app.php.
use Ramonvic\L4Pusher\Facades\Pusher;

Pusher::trigger('my-channel', 'my-event', ['message' => $message]);
// We're done here - how easy was that, it just works!

Documentation

There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of the official Pusher package.

License

L4Pusher is licensed under The MIT License (MIT).