tonyhhyip / laravel-sse
Installs: 1 688
Dependents: 0
Suggesters: 0
Security: 0
Stars: 13
Watchers: 1
Forks: 4
Open Issues: 2
Requires
- php: >=5.5.9
- illuminate/support: ~5.1
- tonyhhyip/sse: ~2.1
This package is not auto-updated.
Last update: 2022-06-07 08:53:04 UTC
README
This library provides Server Sent Event for Laravel using libSSE-php
Supported Laravel Version
- 5.1 (Higher Priority)
- 5.2
- 5.0
Install - Composer
To install Laravel SSE as a Compsoer package to be used in Laravel 5, simply add this to your composer.json
:
"tonyhhyip/laravel-sse": "~1.0"
and run composer update
.
Once it is installed, you can register the SseServiceProvider
in app/config/app.php
in providers
array.
If you want, you can also add the alias SSE:
'providers' => [ ... Sse\Laravel\SseServiceProvider::class ], 'alias' => [ ... 'SSE' => Sse\Laravel\Facade\SSE::class ]
Usage
You can inject the SSE in your controller
class HomeController extends Controller { public function sse(SSE $sse) { // Add your event listener return $sse->createResponse(); } }