PHPackages                             bluex/socket-io - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. bluex/socket-io

ActiveLibrary[HTTP &amp; Networking](/categories/http)

bluex/socket-io
===============

Socket Io Interface For laravel.

521PHP

Since Dec 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Mohamed-Eid/SocketIo)[ Packagist](https://packagist.org/packages/bluex/socket-io)[ RSS](/packages/bluex-socket-io/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

SocketIo
========

[](#socketio)

Simple Socket Io Interface integrated with Laravel Event Broadcasting (like [pusher](https://pusher.com/))

Installation :
==============

[](#installation-)

We’re going to use Composer’s require command to download and install our package

```
composer require bluex/socket-io

```

Then we use this artisan command to install our socket server (written in nodejs-express)

```
php artisan io:install

```

Then install our socket server dependencies using

```
npm install

```

### Switch the broadcast driver to socket io

[](#switch-the-broadcast-driver-to-socket-io)

We need to tell Laravel to use Socket Io Channels for realtime updates. Register the Broadcast application service by opening `config/app.php` and uncommenting this line:

```
// App\Providers\BroadcastServiceProvider::class,

```

and add this line to the `providers array` in same file :

```
Bluex\SocketIo\Providers\SocketIoServiceProvider::class,

```

In your project root’s `.env` file, change the broadcast driver from its default “log” value to “socket-io”.

```
BROADCAST_DRIVER=socket-io

```

scroll further down this file and add your socket server configrations

```
SOCKET_SERVER_URL=127.0.0.1
SOCKET_SERVER_PORT=3000

```

In your `config/broadcasting.php ` file add next code to the `connections array` :

```
'socket-io'  =>  [
    'driver'  =>  'socket-io',
],

```

Usage :
=======

[](#usage-)

### Server Side :

[](#server-side-)

first we need to run our socket server using nodejs :

```
node server.js

```

then make a normal laravel event using `artisan` commands:

```
php artisan make:event TestEvent

```

in the event class just add the channel name \*(now only public channels are available) ex:

```
public  function  broadcastOn()
{
    return  ['testChannel'];
}

```

Then fire your event from anywhere (don't forget to implement `ShouldBroadcastNow` interface if you have a queue worker already running )

#### Client Side :

[](#client-side-)

##### Js Example:

[](#js-example)

```
let  ip_address  =  "{{ env('SOCKET_SERVER_URL') }}";
let  socket_port  =  '3000';
let  socket  =  io(ip_address  +  ':'  +  socket_port,  {
    auth:  {
	    token:  "123",
    }
});
socket.on('testChannel',  (data)  =>  {
	console.log('testChannel : ');
	console.log(data);
});

```

TODO :
======

[](#todo-)

- Unit Test
- Support Private Channels
- Write a documentation
- Add Version Tags

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9136ace58966efb054ac86f8e318767400974354adc4beff56a9be48e9bbb8f?d=identicon)[Mohamed-Eid](/maintainers/Mohamed-Eid)

---

Top Contributors

[![Mohamed-Eid](https://avatars.githubusercontent.com/u/24729835?v=4)](https://github.com/Mohamed-Eid "Mohamed-Eid (22 commits)")

### Embed Badge

![Health badge](/badges/bluex-socket-io/health.svg)

```
[![Health](https://phpackages.com/badges/bluex-socket-io/health.svg)](https://phpackages.com/packages/bluex-socket-io)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
