In this episode, we're getting set up with Laravel Reverb so we'll be ready to build real-time features in our app. Even if you're new to Reverb, no worries—we'll walk through each step together.
We start by installing the necessary broadcasting functionality in Laravel since it's not included by default. Using the Artisan commands, we'll install the broadcasting tools, which sets up a broadcasting config file and publishes a new channels routes file (which we'll be editing soon).
Next, you'll be prompted to install Laravel Reverb. There are a few options for real-time servers, but we’re sticking with Reverb because it’s easy to use, especially in local environments. The install process also sets up Laravel Echo (the client-side library) and installs all the required Node dependencies, so you don’t have to do anything manually there.
Once we’ve got everything installed, we take a look at what changed in our project—checking the .env file for new broadcast settings, looking at default config values, and noticing the new Echo JS file in resources/js. The channels route file has also been created, and we’ll touch on that in the upcoming episodes.
Finally, we fire up the Reverb server using Artisan (with debugging enabled, for now) so it’s running and ready for us to start broadcasting messages. That’s all there is to it—now our app is set up for real-time broadcasting and we’re ready to dive in!