dev-master
9999999-devEasy Laravel Pusher integration with a function.
MIT
The Requires
- php >=5.2
- ext-curl *
- pusher/pusher-php-server ~2.0
by Jesse Szypulski
Easy Laravel Pusher integration with a function.
Easy Laravel pusher integration with a function., (*1)
How this differs from other packages? Full auto-completion support with the Pusher PHP api., (*2)
Installation
composer require kryptonit3/pusher:dev-master
, (*3)
Set environment variables:, (*4)
PUSHER_KEY=YOUR-PUSHER-KEY PUSHER_SECRET=YOUR-PUSHER-SECRET PUSHER_APP_ID=YOUR-PUSHER-APP-ID
Add the following to your Service Providers array (config\app.php), (*5)
Kryptonit3\Pusher\PusherServiceProvider::class, // for older PHP versions use 'Kryptonit3\Pusher\PusherServiceProvider',
Publish the config file. (not required unless you want to change some default settings), (*6)
php artisan vendor:publish
It will then be located in config\kryptonit3_pusher.php
, (*7)
you may now use all of the normal pusher calls with the pusher()
helper function., (*8)
Example, (*9)
pusher()->trigger('my-channel-name', 'my-event-name', ['data' => true]);
Here are some more examples - https://github.com/pusher/pusher-http-php#publishingtriggering-events, (*10)
Just replace the $pusher->
with pusher()->
, (*11)
Easy Laravel Pusher integration with a function.
MIT