Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Laravel reverb vapor


Laravel reverb vapor


Unfortunately, the search results do not directly address how to use Laravel Reverb with Vapor. However, based on the information provided, here is a summary of what I can infer:

Reverb and Vapor Compatibility

According to Taylor Otwell, Reverb is not "really Vapor compatible, at least on day one." The reason is that Vapor is designed around a serverless mentality, where you don't have to manage servers yourself.

Otwell suggests that for Vapor applications, you would likely want to use a serverless WebSocket solution like Pusher or Ably, rather than running your own Reverb server.

Potential Workaround

If you still want to use Reverb with a Vapor application, the suggested approach is to run the Reverb server on a traditional server, separate from your Vapor application. Then, you can have your Vapor application connect to the remote Reverb server.

This would involve:

1. Provisioning a traditional server (e.g., through Forge) to host the Reverb server.
2. Configuring your Vapor application to connect to the remote Reverb server, likely using the `REVERB_HOST` and `REVERB_PORT` environment variables.

However, this approach goes against the serverless philosophy of Vapor, as you would need to manage the Reverb server separately.

In summary, while it is possible to use Reverb with a Vapor application by running the Reverb server on a separate traditional server, Otwell suggests that a more "Vapor-friendly" approach would be to use a serverless WebSocket solution like Pusher or Ably instead.

Citations:
[1] https://laravelpodcast.com/episodes/laravel-11-reverb-herd-windows-pro-other-laracon-eu-recap/transcript
[2] https://www.youtube.com/watch?v=gv9z1yv0_7k
[3] https://laravel.com/docs/11.x/reverb
[4] https://github.com/laravel/reverb/issues/107
[5] https://reverb.laravel.com