L4Pusher - Laravel 4 Bridge for official pusher
, (*1)
L4Pusher is a Pusher bridge for Laravel 4 using the official Pusher package., (*2)
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., (*3)
// 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., (*4)
composer require ramonvic/l4-pusher
Add the service provider to config/app.php
in the providers
array., (*5)
'Ramonvic\L4Pusher\PusherServiceProvider'
If you want you can use the facade. Add the reference in config/app.php
to your aliases array., (*6)
'L4Pusher' => 'Ramonvic\L4Pusher\Facades\Pusher'
Looking for a Laravel 5 compatible version?
Please use @vinkla's Laravel Pusher package instead., (*7)
Configuration
L4Pusher requires configuration. To get started, you'll need to publish all vendor assets:, (*8)
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., (*9)
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:, (*10)
// 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., (*11)
License
L4Pusher is licensed under The MIT License (MIT)., (*12)