
So you love building real-time features in Laravel? Me too. But let’s face it — setting up WebSockets in Laravel can be… exhausting. Between server infrastructure, scaling, and configuration, it often feels like more trouble than it’s worth.
That’s why I was excited to try out AnyCable Laravel Broadcaster, a new integration that lets Laravel play nicely with AnyCable, the drop-in ActionCable replacement written in Go.
Why I Looked for an Alternative to Laravel WebSockets
Laravel already has support for broadcasting via Pusher or its own laravel-websockets
package. But here’s the deal:
- Self-hosted Laravel WebSockets works great… until you need to scale.
- Pusher is nice, but pricing gets steep fast.
- Managing Redis, workers, and queues for real-time gets messy quickly.
I needed something that was fast, scalable, and didn’t make me pull my hair out.
What Is AnyCable, and Why Should Laravel Devs Care?
AnyCable is a real-time WebSocket server designed to work with ActionCable (from the Rails world), but it also works great with other backends — now including Laravel!
Here’s why it matters:
- Written in Go — which means blazing fast.
- Minimal setup, especially if you already use Redis.
- Perfect for scaling real-time apps on modern infrastructure.
With this new broadcaster package, Laravel developers can now broadcast events to AnyCable out-of-the-box — just like they would with Pusher.
Getting Started: Installing the Package
First, install the broadcaster package:
composer require anycable/laravel-broadcaster
Then register the broadcaster in your config/broadcasting.php
:
'connections' => [
'anycable' => [
'driver' => 'anycable',
'key' => env('ANYCABLE_API_KEY'),
'url' => env('ANYCABLE_API_URL', 'http://localhost:9292/cable'),
],
],
You’ll also want to add ANYCABLE_API_KEY
and ANYCABLE_API_URL
to your .env
.
Finally, set your default broadcaster:
BROADCAST_DRIVER=anycable
And that’s it. Now your Laravel events can broadcast through AnyCable just like you would with Pusher or Ably.
What I Like About This Setup
1. It’s Fast and Scalable
Because it’s built on Go, AnyCable can handle thousands of connections with minimal CPU usage. Great for apps that expect high concurrency (like chats, live dashboards, etc.).
2. It Works with Laravel Broadcasting Natively
No need to re-architect your app. If you’ve used broadcasting events before, it’s the same flow:
broadcast(new OrderUpdated($order));
3. It Pairs Well with Redis and Sidekiq
If you’re building hybrid Laravel + Rails apps, or microservices, this setup fits in beautifully.
Final Thoughts
AnyCable Laravel Broadcaster fills a huge gap for developers who want real-time performance without real-time headaches. It’s fast, simple to use, and a joy to work with once it’s set up.
Whether you’re scaling an existing Laravel app or starting something new that needs WebSocket-style interactivity, this is one tool worth keeping in your toolbox.
Give it a try — and let your app breathe real-time without the pain.
Pro Tip:
Pair this with Laravel Echo or Phoenix LiveView-style updates for a silky-smooth frontend experience.