PHP code example of tonyhhyip / laravel-sse
1. Go to this page and download the library: Download tonyhhyip/laravel-sse library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tonyhhyip / laravel-sse example snippets
'providers' => [
...
Sse\Laravel\SseServiceProvider::class
],
'alias' => [
...
'SSE' => Sse\Laravel\Facade\SSE::class
]
class HomeController extends Controller
{
public function sse(SSE $sse)
{
// Add your event listener
return $sse->createResponse();
}
}