Why Laravel Echo Whispers Never Reach Your Server
Raheel Shan
November 23rd, 2026 · 12 min read
In the first article, I covered how Laravel sends an event from the server to the browser. That works well when Laravel is the one starting the conversation. But what happens when the browser needs to send something back?
This is where I ran into a limitation with Laravel's WebSocket setup.
A whisper can go from one browser to another browser. It does not go to Laravel. That means Laravel cannot validate it, process it, or save it to the database.
I discovered this while building a typing indicator and then trying to use the same approach for actual chat messages. Those two things look similar on the frontend. They should not be implemented the same way.
Server to client works
The server-to-browser part is straightforward.
A Laravel event implements ShouldBroadcast, Laravel broadcasts it, and Echo receives it.
For example:
class OrderShipped implements ShouldBroadcast
{
public function broadcastOn(): Channel
{
return new PrivateChannel(
'orders.' . $this->order->user_id
);
}
}
On the frontend:
Echo.private(`orders.${userId}`)
.listen('OrderShipped', (e) => {
console.log(e.order);
});
The direction is simple:
Laravel → WebSocket → browser
Laravel decides something happened.
The browser reacts to it.
Browser to browser: whispers
Echo provides whisper() when the browser needs to send a small real-time event to other clients.
For example, a typing indicator:
const channel = Echo.private(`chat.${roomId}`);
// Sender
channel.whisper('typing', {
name: user.name
});
// Other clients
channel.listenForWhisper('typing', (e) => {
showTyping(e.name);
});
This is useful because Laravel does not need to be involved.
The browser sends the event through the WebSocket connection and the WebSocket server forwards it to the other clients subscribed to that channel.
For a typing indicator, that is exactly what I want.
I don't need to store:
Raheel is typing.
—
I don't need a database record for it. I don't even care if the event disappears. But that changes completely when the data matters.
A whisper is not a database message
There are a few important limitations with whispers.
You need:
- A private or presence channel
- Client events enabled on the WebSocket server
- Another client currently connected to receive the event
The exact configuration depends on the WebSocket server.
With laravel-websockets, for example, client messages need to be enabled in the WebSocket configuration.
And there is an important difference from a normal Laravel request.
Laravel is not involved. There is no controller. There is no FormRequest. There is no authentication or validation happening in your application code. There is no database write.
If the other user is offline, the event is simply gone. For a typing indicator, that is fine. For a chat message, it is not. A chat message needs to be stored somewhere. The receiver may be offline. The sender may need confirmation that the message was saved. The application may need to validate it. At that point, whisper() is the wrong tool.
What I was used to with SignalR
I had worked with SignalR before, so I was expecting something slightly different.
In SignalR, the browser can call a method on the server-side hub.
For example:
public class ChatHub : Hub
{
public async Task SendMessage(
string user,
string message
)
{
// validate
// save to the database
// deliver to clients
await Clients.All.SendAsync(
"ReceiveMessage",
user,
message
);
}
}
The browser calls that method over the same connection:
await connection.invoke(
"SendMessage",
user,
message
);
The important part for me was not SignalR itself.
It was the communication model.
Browser → socket → server code → database → socket → browsers
The same connection handles the real-time communication in both directions.
When I looked for the same model in Laravel's WebSocket stack, I couldn't find it. That meant I needed another approach.
Workaround 1: send an HTTP request
The first solution is actually the most obvious one. Don't use the WebSocket for sending the message to the server. Use a normal Laravel request.
For example:
await axios.post(
`/rooms/${roomId}/messages`,
{
body
}
);
Laravel then handles it like any other request:
public function store(
Request $request,
Room $room
) {
$data = $request->validate([
'body' => 'required|max:2000',
]);
$message = $room->messages()->create([
'user_id' => auth()->id(),
'body' => $data['body'],
]);
broadcast(
new MessageSent($message)
)->toOthers();
return $message;
}
There is nothing particularly clever here. And that is actually the good part. Authentication, validation, authorization and database operations stay inside the normal Laravel request lifecycle. After saving the message, Laravel broadcasts the event to the other clients.
So the flow becomes:
Browser → HTTP → Laravel → database → WebSocket → other browsers
It works. It is easy to understand. It is also easy to maintain. But now I am using two transports. WebSocket is used to receive real-time events. HTTP is used to send data to Laravel. For normal applications, I would not consider this a serious problem.
For a high-frequency real-time application, it becomes something worth considering. Every message becomes a complete HTTP request with the normal middleware and application lifecycle.
Workaround 2: listen for whispers on the server
The second approach was more interesting.
With laravel-echo-server, client events could pass through Redis. That meant I could have another long-running process subscribe to the relevant Redis channel and react to those messages.
The basic idea looked something like this:
// Custom Artisan command
// Kept alive by Supervisor
Redis::subscribe(
['your-whisper-channel'],
function ($payload) {
$data = json_decode(
$payload,
true
);
Message::create([
'room_id' => $data['room'],
'body' => $data['body'],
]);
}
);
And the process would stay alive with something like:
php artisan whispers:listen
This actually worked. The browser sent the whisper. The event went through Redis. The long-running Laravel process received it. The message was saved to the database. It solved the problem. But it also created another problem.
The stack kept getting bigger
At this point I was running:
- The Laravel application
- A queue worker
- Redis
- The Node.js Echo server
- Another long-running PHP process just to receive whispers
The last one bothered me the most.
I had created a separate process whose main job was to sit there and wait for messages coming from the browser.
And I still had to build the things that Laravel normally gives me for free in a normal request:
- Authentication
- Validation
- Authorization
- Error handling
- Retry handling
If that process crashed, the whispers were gone. There was no normal Laravel request waiting to retry the operation. It brought me back to the same operational problems from the first article. The application could be running. The WebSocket server could be running. And yet the real-time feature could still silently fail.
Comparing the approaches
This is how I ended up looking at the different models:
| SignalR | Laravel + POST | Laravel + whisper listener | |
|---|---|---|---|
| Browser sends over socket | Yes | No, HTTP | Yes |
| Server code runs per message | Yes | Yes | Yes, separate process |
| Authentication and validation | Hub | Controller | You build it |
| Extra process | None | None | One more |
| Offline receiver | Your choice | Saved, fetched later | Saved, fetched later |
The HTTP approach is not bad. In fact, for many Laravel applications, it is probably the most sensible solution.
The problem was that I was looking for a clean real-time communication model where the browser could send directly through the WebSocket connection, Laravel could handle the message, and the application could still use the normal Laravel architecture.
The whisper listener got closer to that idea, but at the cost of another long-running process.
Where this left me
At this point, my real-time stack had become fairly complicated.
I had:
- Broadcasting
- Echo
- WebSockets
- Redis
- Queue workers
- Node.js
- Additional long-running processes
And I still had not solved the basic problem I wanted to solve cleanly:
Browser → Laravel over WebSocket
That was the part I was missing. Then Laravel introduced its own WebSocket server. Laravel Reverb. That changed the architecture considerably. That is what I will cover in the next article.
Previous: 7 Moving Parts Just to Send One Real-Time Message in Laravel
Next: Laravel Reverb, and how much of the old WebSocket stack it removed.
Comment "REVERB" if you have run into the same limitation.
Found this useful?
Support the work that goes into these posts.