PHP code example of pollsockets / pollsockets-laravel
1. Go to this page and download the library: Download pollsockets/pollsockets-laravel 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/ */
pollsockets / pollsockets-laravel example snippets
use Pollsockets\Drivers\RedisChannel;
return [
'driver' => RedisChannel::class,
];
use Pollsockets\Pollsockets;
// Channel name can be any string. Can be used to separate events from different sources.
$channelName = 'channel';
// Event name can be any string. Can be used to separate events of the same type.
$event = 'reload';
// Publish an event to the channel from anywhere in your code. Perfect for informing client about changes in the database.
Pollsockets::channel($channelName)->publish($event);
bash
php artisan vendor:publish --tag="pollsockets-config"