PHPackages                             sentixtech/websocket - 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. sentixtech/websocket

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

sentixtech/websocket
====================

Advanced WebSocket package for Laravel with broadcasting capabilities

1.0.1(1y ago)07MITPHPPHP ^7.4|^8.0

Since Jan 26Pushed 1y ago1 watchersCompare

[ Source](https://github.com/sentixtech/websocket)[ Packagist](https://packagist.org/packages/sentixtech/websocket)[ RSS](/packages/sentixtech-websocket/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (4)Used By (0)

SentixTech WebSocket Package for Laravel
========================================

[](#sentixtech-websocket-package-for-laravel)

Overview
--------

[](#overview)

A powerful, flexible WebSocket implementation for Laravel applications, enabling real-time communication across various use cases.

Features
--------

[](#features)

- Dynamic channel creation
- Flexible subscription management
- Generic event broadcasting
- User-specific and global messaging
- Comprehensive error handling
- Detailed logging

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

[](#installation)

### Composer Installation

[](#composer-installation)

```
composer require sentixtech/websocket
```

### Publish Configuration

[](#publish-configuration)

```
php artisan vendor:publish --provider="SentixTech\WebSocket\WebSocketServiceProvider"
```

### Configure WebSocket Server

[](#configure-websocket-server)

Edit `config/websocket.php`:

```
return [
    'host' => env('WEBSOCKET_HOST', 'localhost'),
    'port' => env('WEBSOCKET_PORT', 8080),
    'max_clients' => env('WEBSOCKET_MAX_CLIENTS', 1000),
    'max_frame_size' => env('WEBSOCKET_MAX_FRAME_SIZE', 1024 * 1024), // 1MB
];
```

### Start WebSocket Server

[](#start-websocket-server)

```
php artisan websocket:serve
```

Usage Examples
--------------

[](#usage-examples)

### Channel Management

[](#channel-management)

```
// Create channels
WebSocket::createChannel('notifications');
WebSocket::createChannel('user_events');
```

### Subscription

[](#subscription)

```
// Subscribe a client to a channel
WebSocket::subscribe($socketResource, 'notifications', $userId);

// Unsubscribe from a channel
WebSocket::unsubscribe($socketResource, 'notifications', $userId);
```

### Broadcasting

[](#broadcasting)

```
// Broadcast to all channel subscribers
WebSocket::broadcast('notifications', [
    'type' => 'alert',
    'message' => 'System maintenance in 10 minutes'
]);

// Broadcast to specific users
WebSocket::broadcast('notifications', $message, [
    'users' => [1, 2, 3] // Only send to these user IDs
]);
```

### Event Emission

[](#event-emission)

```
// Emit a generic event
WebSocket::emit('user_login', [
    'user_id' => 123,
    'timestamp' => now()
]);
```

### Channel Monitoring

[](#channel-monitoring)

```
// Get number of channel subscribers
$subscriberCount = WebSocket::subscribers('notifications');
```

Advanced Usage
--------------

[](#advanced-usage)

### Real-time Notifications

[](#real-time-notifications)

```
// Send a notification to specific users
WebSocket::broadcast('notifications', [
    'title' => 'New Message',
    'content' => 'You have a new message from John',
    'user_ids' => [5, 10] // Only notify these users
]);
```

### Chat System Integration

[](#chat-system-integration)

```
// Send a chat message
WebSocket::broadcast('chat_room_1', [
    'sender_id' => Auth::id(),
    'message' => $messageContent
]);
```

Security
--------

[](#security)

- Supports user-specific channel subscriptions
- Flexible access control
- Comprehensive error logging

Performance
-----------

[](#performance)

- Non-blocking socket implementation
- Configurable max clients and frame size
- Efficient channel and user management

Error Handling
--------------

[](#error-handling)

All methods return boolean or integer status:

- `createChannel()`: Returns `true/false`
- `subscribe()`: Returns `true/false`
- `broadcast()`: Returns number of successful broadcasts
- `emit()`: Returns number of successful event emissions

Troubleshooting
---------------

[](#troubleshooting)

- Check `storage/logs/laravel.log` for WebSocket errors
- Ensure WebSocket server is running
- Verify configuration in `config/websocket.php`

Requirements
------------

[](#requirements)

- PHP 7.4+
- Laravel 8.0+
- Sockets extension

Contributing
------------

[](#contributing)

Contributions are welcome! Please submit pull requests to the repository.

License
-------

[](#license)

MIT License

Support
-------

[](#support)

For issues and support, please open a GitHub issue in the repository.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

523d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/837022?v=4)[Sentix](/maintainers/Sentix)[@sentix](https://github.com/sentix)

---

Top Contributors

[![sentixtech](https://avatars.githubusercontent.com/u/147980203?v=4)](https://github.com/sentixtech "sentixtech (1 commits)")

### Embed Badge

![Health badge](/badges/sentixtech-websocket/health.svg)

```
[![Health](https://phpackages.com/badges/sentixtech-websocket/health.svg)](https://phpackages.com/packages/sentixtech-websocket)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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