Playing
04. Toggling Reverb

Transcript

00:00
Forge makes it really easy to toggle and automatically configure Laravel Reverb on a server. If we head over to the Laravel Reverb docs over in the running reverb in production section, you'll notice quite a long list of tasks you'll need to complete. Now, because we're using Laravel Forge and we have the ability to toggle this in the application section, this is just going to do everything for us.
00:26
So let's head down to the section just here under our Laravel application. This is going to detect what we're running on our server. And of course we do have Laravel Reverb installed. So it gives us this option just here.
00:39
We're going to go ahead and hit toggle on this, and we're not really going to do anything here. You can change the max concurrent connections if you want to bump them up, if you expect more traffic. And this is probably the most important part, the public host name. We're going to run our WebSocket server on a sub domain for our application.
00:58
So we're going to leave this as it is, but of course you're free to customize the actual sub domain part of this if you want to. So let's go ahead and run start Laravel Reverb and then let's see what happens on the server. Okay. We'll just wait for this to finish and then we'll check out what's happened.
01:13
Okay. That looks like it's done. So let's head over to our server section and open up Reverb, which is the server we've created here. If we head over to the daemon section, you'll notice that this is created one here for us.
01:26
And it's using this command here, PHP with the version number artisan reverb star, exactly like we would do on a local machine. And we have a no interaction and a specified port here. If you need to change the port, you can come over here to change this. We're not going to do that, but you can change it there if you need to.
01:44
If you need to restart Reverb for any reason, you can go ahead and click restart daemon here. And that will go ahead and restart that for you. In the background, forge will have done a couple of other things that are listed in the documentation. So if you need to tweak anything there, you can head straight over to the Reverb docs to tweak anything that you need.
02:03
Let's check out what else has happened here. If we head back over to our site that we've created and we head over to the environment section, we have our EMV file set up. But if we head down here, you can see that the Reverb host will automatically change to the domain that we specified. This is great because we don't need to modify this and we will be coming back here later to change over the port and scheme once we get our SSL certificate set up.
02:28
At this stage, if you do want to configure anything here, or you've forgotten to copy over any of the credentials for your Reverb app and server, go ahead and do that now. And really importantly, make sure you have your Veet exposed credentials in here as well. But that's pretty much it. We now have Reverb technically running on our server.
7 episodes 16 mins

Overview

So you’ve built a realtime application. Now it’s time to deploy it.

Laravel Forge makes it incredibly easy to toggle Reverb, which configures your server for you and sets up (nearly) everything you need to broadcast and listen for events.

In this course, we’ll cover every step needed to get an local example application deployed to a production server, with a separate subdomain reserved for your Reverb connections.

Alex Garrett-Smith
Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Comments

No comments, yet. Be the first to leave a comment.