Skip to content

Instantly share code, notes, and snippets.

View Slooowpoke's full-sized avatar

Mali Slooowpoke

View GitHub Profile
@sebastiaanluca
sebastiaanluca / NewMessage.php
Last active October 1, 2024 08:06
Laravel + Redis + NodeJS + Socket.io pub/sub secure server and client supporting multiple rooms, channels, users, … Add `client.js` to your client app, run `node server.js`, and trigger the Laravel event any way you want to broadcast the data.
<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class NewMessage extends Event implements ShouldBroadcast
{