laravel / reverb

Laravel Reverb provides a real-time WebSocket communication backend for Laravel applications.
https://reverb.laravel.com
MIT License
1.05k stars 76 forks source link

Laravel Sail integration #231

Closed JakubSzczesniak closed 1 month ago

JakubSzczesniak commented 1 month ago

Currently, the solution does not work with the standard Laravel Sail setup because Sail uses the Artisan server instead of Nginx. It would be beneficial if the sail up command could set up both a web server and a WebSocket server with Reverb.

driesvints commented 1 month ago

Thanks. Right now we don't have plans for this, sorry.

wazimshizm commented 1 month ago

wait what? reverb is literally the next item under sail in the laravel docs, but it doesn't work together?

TylerByte666 commented 10 hours ago

Hey all!

Reverb works perfectly well with sail. You just need some added config for ports: in your docker-compose.yml:

        ports:
            - '${APP_PORT:-80}:80'
            - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
            - '${REVERB_PORT:-8080}:${REVERB_PORT:-8080}'

Just be sure to stop and start sail again to apply the new config. As for the other requirements you can set supervisor to monitor the reverb server, and create your own start arguments too. Hope that helps.

wazimshizm commented 3 hours ago

Hey all!

Reverb works perfectly well with sail. You just need some added config for ports: in your docker-compose.yml:

        ports:
            - '${APP_PORT:-80}:80'
            - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
            - '${REVERB_PORT:-8080}:${REVERB_PORT:-8080}'

Just be sure to stop and start sail again to apply the new config. As for the other requirements you can set supervisor to monitor the reverb server, and create your own start arguments too. Hope that helps.

Thanks Tyler yeah I misunderstood this, it sounded like this thread implied sail doesn't work with reverb full stop. I got it working, but the reverb documentation is shockingly bad and makes a lot of assumptions about previous knowledge I think. In my case I found what I needed to make reverb work (Authorizing private broadcast channels) hidden in the sanctum documentation.