Download the PHP package blax-software/laravel-websockets without Composer
On this page you can find all versions of the php package blax-software/laravel-websockets. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-websockets
Laravel WebSockets
Plug-and-play WebSockets for Laravel with a Pusher-compatible protocol, async fork-based handling, attribute-driven routing, and live operational tooling.
[!NOTE] This package is actively maintained as a fork of beyondcode/laravel-websockets.
Features
#[Websocket]attribute on regular HTTP controllers — turn any controller method into a WebSocket-callable endpoint with one annotation, no second class to maintain- Async processing — incoming messages are handled in
pcntl_forkchild processes, so a slow handler never blocks the event loop - Broadcast from anywhere —
ws_broadcast(),ws_whisper(),ws_broadcast_except()helpers and a staticWebsocketServiceAPI let any controller, job, or service push events to any channel - Multiple channel types — public,
private-*,presence-*, andopen-presence-*channels with the standard auth handshake -
Live ops tooling —
php artisan websockets:watchrenders connection counts, authenticated users, and per-channel connections, refreshing every second: - Automatic route recognition — controller class and method names map to event names automatically (
FlightschoolController::index→flightschool.index); override per method or per class via#[Websocket(event: ..., prefix: ..., suffix: ..., needAuth: true)] - Hot code reload in dev, OPcache in prod —
websocket:steer cache:clearclears OPcache and the controller resolver cache without restarting the running server, so iteration is instant in development while production runs with fully warmed caches - Pusher-compatible protocol — supports both modern
websocket.*and legacypusher:*action formats, drop-in for Echo and pusher-js clients - Test helpers —
newConnection(),newActiveConnection(),newPrivateConnection(),newPresenceConnection(), plusassertSentEvent()keep WebSocket tests short
Requirements
- PHP 8.1+
- Laravel 9, 10, 11 or 12
ext-pcntl(for async fork-based handling)
Installation
Publish the config:
Start the server:
Default URL is ws://127.0.0.1:6001.
Quick Start
1. Mark a regular controller method as WebSocket-reachable
2. Broadcast from anywhere
3. Per-connection session store
Inside a WebSocket handler, wsSession() returns a Redis-backed key/value store scoped to the
current connection that persists across messages on the same socket. It takes no arguments.
4. Watch live stats
5. Iterate without restarting
Channel Types
| Type | Prefix | Description |
|---|---|---|
| Public | (none) | Anyone can subscribe |
| Private | private- |
Server-signed auth required |
| Presence | presence- |
Auth required, tracks user list, broadcasts join/leave |
| Open Presence | open-presence- |
Presence semantics without the auth signature — useful for guests |
Testing
Documentation
- Main docs: docs
- Getting started: docs/getting-started/introduction.md
- Helper & testing guide: docs/advanced-usage/helpers-and-testing.md
- Custom handlers: docs/advanced-usage/custom-websocket-handlers.md
Changelog
See CHANGELOG.
Security
Please report vulnerabilities via the issue tracker or by email: [email protected].
Credits
- Marcel Pociot
- Freek Van der Herten
- All Contributors
License
MIT. See LICENSE.md.
Star History
All versions of laravel-websockets with dependencies
ext-json Version *
cboden/ratchet Version ^0.4.1
facade/ignition-contracts Version ^1.0
guzzlehttp/psr7 Version ^1.7|^2.0
illuminate/broadcasting Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/console Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/http Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/routing Version ^6.0|^7.0|^8.0|^9.0|^10.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.0|^10.0
pusher/pusher-php-server Version ^3.0|^4.0|^5.0|^6.0|^7.0
react/dns Version ^1.1
react/http Version ^1.1
symfony/http-kernel Version ^4.0|^5.0|^6.0
symfony/psr-http-message-bridge Version ^1.1|^2.0