1. Go to this page and download the library: Download hosmelq/sse-saloon 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/ */
hosmelq / sse-saloon example snippets
use HosmelQ\SSE\Saloon\Traits\HasServerSentEvents;
use Saloon\Http\Request;
use Saloon\Enums\Method;
class StreamNotifications extends Request
{
use HasServerSentEvents;
protected Method $method = Method::GET;
public function resolveEndpoint(): string
{
return '/notifications/stream';
}
}