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-11-22 03:18:19 |
Package Statistics | |
---|---|
Total Downloads: | 846 |
Monthly Downloads: | 5 |
Daily Downloads: | 0 |
Total Stars: | 0 |
Total Watchers: | 1 |
Total Forks: | 0 |
Total Open Issues: | 0 |
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');
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'
Please use @vinkla's Laravel Pusher package instead.
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.
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!
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.
L4Pusher is licensed under The MIT License (MIT).