In this episode, we kick things off by setting up a new Laravel application specifically for real-time broadcasting using Laravel Reverb. We take you through the process of creating a fresh Laravel project (using the Breeze starter kit with Blade and Alpine, though the starter kit doesn't really matter), and make sure you have broadcasting ready to go.
After initializing the app, we look at how fresh Laravel setups now don't assume real-time is required out of the box—you won't find Echo or Reverb config just sitting there. So, we use Laravel's install command to add broadcasting. You'll see how this command not only creates necessary config files, but also prompts you to install Laravel Reverb itself.
We walk through the changes made by installing Reverb: new entries in your .env
file, a dedicated reverb.php
config file, and a new channels.php
routes file. There's really nothing you have to change for local development, but you get a quick rundown on the config and where all the important settings live—like the app ID, keys, allowed origins, and more. We also touch on the Laravel Echo client, which will pick up server-side broadcasted events later on.
Finally, we learn how to actually start the Reverb server using Artisan, including how to enable debug mode to see what's going on in real time. There's a word of caution not to use debug mode in production because of the volume of data that can crash your server!
By the end of this episode, you'll have Laravel Reverb fully installed, a good sense of the config options, and you'll be ready to move on to defining channels and broadcasting your first events.