ramonvic / l4-pusher
Pusher.com service provider for Laravel 4, ith all settings configurable
Requires
- php: >=5.3.0
- illuminate/log: ~4.0
- illuminate/support: ~4.0
- pusher/pusher-php-server: ~2.2
Requires (Dev)
- mockery/mockery: ~0.9.2
- phpunit/phpunit: ~4.0
This package is auto-updated.
Last update: 2024-11-08 07:26:00 UTC
README
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).