PHP code example of naturalweb / laravel-socketcluster
1. Go to this page and download the library: Download naturalweb/laravel-socketcluster 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/ */
naturalweb / laravel-socketcluster example snippets
namespace App\Events;
use App\Events\Event;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class PublishToSocketClusterEvent implements ShouldBroadcast
{
use SerializesModels;
public $message;
public function __construct($message)
{
$this->message = $message;
}
public function broadcastOn()
{
return ['<channel>'];
}
}