PHPackages                             neoan.io/broadcast - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. neoan.io/broadcast

ActivePackage[Utility &amp; Helpers](/categories/utility)

neoan.io/broadcast
==================

Uses socket.io broadcasting simplified

v0.1.0(3y ago)120JavaScript

Since Jan 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/sroehrl/broadcast)[ Packagist](https://packagist.org/packages/neoan.io/broadcast)[ RSS](/packages/neoanio-broadcast/feed)WikiDiscussions internal Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

3-way data-binding with PHP &amp; socket.io
===========================================

[](#3-way-data-binding-with-php--socketio)

Keep multiple clients &amp; your database in sync!

Designed for [LENKRAD](https://lenkrad.neoan3.rocks), but agnostic enough to be used in any framework.

> Make any database a live-database

Installation
------------

[](#installation)

### 1. install package

[](#1-install-package)

`composer require neoan.io/broadcast`

### 2. Add required ENV-variables to your .env

[](#2-add-required-env-variables-to-your-env)

- JWT\_SECRET (your encryption key)
- SOCKET\_SERVER\_PORT (e.g. 3000)
- SOCKET\_SERVER\_URL (e.g. "localhost")

### 3. Add the following script to your composer.json

[](#3-add-the-following-script-to-your-composerjson)

```
...
"scripts": {
  "install-socket": "NeoanIo\\MarketPlace\\Broadcast\\NpmHandler::package"
}
...
```

### 4. Run said script

[](#4-run-said-script)

`composer run install-socket`

### 5. Install required node packages

[](#5-install-required-node-packages)

`yarn install` or `npm install`

### 6. Test socket-server

[](#6-test-socket-server)

`yarn sockert-server` or `npm run socket-server`

Setup
-----

[](#setup)

### Client functionality

[](#client-functionality)

This package includes a client-library to automate synchronization with your database. In LENKRAD, you would typically expose the library via a route:

```
