Scaling Real-Time Connectivity Real-time features define the modern web, but the infrastructure behind them often presents a steep hurdle. Traditionally, developers had to choose between wrestling with complex Pusher configurations or maintaining their own expensive server clusters. Laravel Cloud solves this by offering a fully managed Laravel Reverb experience. This guide will help you bridge the gap between local development and production-scale real-time broadcasting without touching a single environment variable. Tools and Prerequisites Before you begin, ensure your application is already functional with a local Reverb instance. You will need: * A Laravel application pushed to a GitHub repository. * Broadcasting events and Laravel Echo hooks already implemented in your code. * An active Laravel Cloud account. Step-by-Step Deployment 1. **Push Your Code**: Deploy your application to Laravel Cloud directly from your repository. At this stage, your real-time features won't work yet because the production environment lacks a WebSocket server. 2. **Add the Resource**: Navigate to your application dashboard and select **Add New Resource**. Choose **WebSocket Cluster** from the list of managed services. 3. **Select a Tier**: For small apps or demos, the entry-tier allows for 100 concurrent connections at a low monthly cost. Select your capacity and click **Create**. 4. **Save and Deploy**: Once the resource is added, click **Save and Deploy**. The platform automatically injects the necessary configuration into your environment so that your code recognizes the new Laravel Reverb cluster. Managing Cluster Capacity As your user base grows, you can adjust your scale without downtime. Access your **Account Settings**, then navigate to **Resources** and **WebSockets**. From here, you can select your cluster (e.g., "Reverb Demo") to view live usage metrics or increase your concurrent connection limit to 5,000 or more. The platform handles the underlying orchestration, keeping your focus on building features rather than managing pings and heartbeats. Conclusion The beauty of this workflow is the zero-config handoff. Because Laravel Cloud manages the Laravel Reverb server internally, the transition from local `php artisan reverb:start` to a globally available cluster is seamless. You gain a robust, scalable WebSocket infrastructure that just works the moment you hit deploy.
Pusher
Products
Across 6 mentions, the Laravel channel frames Pusher as a complex legacy configuration that developers now navigate or bridge using compatible tools like Reverb, specifically highlighted in "Laravel Cloud Has Managed Reverb Now."
- Nov 13, 2025
- Oct 11, 2025
- Jul 24, 2025
- May 24, 2025
- Apr 18, 2024
Overview Modern users demand instant feedback. Whether it is a chat message or a background job finishing, waiting for a page refresh feels like an eternity. Laravel bridges this gap using **WebSockets**, allowing your server to push updates directly to the client the moment they happen. This tutorial explores how to move from static requests to a dynamic, event-driven architecture. Prerequisites To follow along, you should have a solid grasp of PHP and basic Laravel concepts like Events and Listeners. You will also need Node.js installed for managing front-end dependencies via NPM. Key Libraries & Tools * Pusher: A hosted service that handles the heavy lifting of WebSocket connections. * **Laravel Echo**: A JavaScript library that makes it painless to subscribe to channels and listen for events. * **Pusher PHP SDK**: The bridge that allows your server-side code to communicate with Pusher. Code Walkthrough 1. Server Configuration First, pull in the necessary package and configure your `.env` file with your Pusher credentials. You must also uncomment the `BroadcastServiceProvider` in `config/app.php` to enable the broadcasting routes. ```bash composer require pusher/pusher-php-server ``` 2. Preparing the Event To make an event broadcastable, implement the `ShouldBroadcast` interface. This tells Laravel to push the event into your queue for broadcasting instead of just executing local listeners. ```python class OrderPlaced implements ShouldBroadcast { public function __construct(public Order $order) {} public function broadcastOn() { return new PrivateChannel('orders.' . $this->order->id); } } ``` 3. Front-end Integration On the client side, use Laravel Echo to listen. We use the `private` method to ensure only authorized users access this specific data stream. ```javascript Echo.private(`orders.${orderId}`) .listen('OrderPlaced', (e) => { console.log('Order update received:', e.order); }); ``` Syntax Notes Notice the `broadcastOn` method. It defines the transmission path. Using `PrivateChannel` triggers an authorization check, whereas `Channel` creates a public stream. Laravel automatically uses the event's class name as the broadcast name, so keep your naming conventions consistent between PHP and JavaScript. Practical Examples * **Notifications**: Alerting a user that their report is ready for download. * **Live Dashboards**: Updating stock prices or server health metrics without refreshing. * **Collaboration**: Showing "User is typing..." indicators in a shared workspace. Tips & Gotchas Always remember to run `php artisan queue:work`. Broadcasting is an asynchronous task; if your queue worker isn't running, your events will sit in the database or Redis and never reach the client. For local development, ensure your `BROADCAST_DRIVER` is set to `pusher` rather than `log`.
Oct 19, 2021