I want to use reactphp socket for push notifications in laravel but I do not know what to do?
route:
Route::get('/test', function () {
event(new testEvent($test));
});
event:
public $test;
public function __construct($test)
{
$this->test = $test;
}
public function broadcastOn()
{
return new PrivateChannel('test.' . $this->test->id);
}
channel:
Broadcast::channel('test.{test}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
Note: I do not want to use the pusher