If you don't want to use Pusher as your WS server which is the default one, then you can follow one of the options bellow to configure your app and get it running with your custom server
beyondcode/laravel-websockets
To replace Pusher with beyondcode/laravel-websockets you have to install & configure it with your app.. then modify your app's .env file as following:
config/chatify.php
PUSHER_APP_ID=pusher_app_id# Any random stringPUSHER_APP_KEY=pusher_app_key# Any random stringPUSHER_APP_SECRET=pusher_app_secret# Any random stringPUSHER_HOST=127.0.0.1# Server hostPUSHER_PORT=6001# Server portPUSHER_SCHEME=http# For SSL use `https`, otherwise use `http`.PUSHER_APP_CLUSTER=mt1LARAVEL_WEBSOCKETS_PORT="${PUSHER_PORT}"# Laravel WS portLARAVEL_WEBSOCKETS_SSL_LOCAL_PK=private_key_path# Optional for using SSL.LARAVEL_WEBSOCKETS_SSL_LOCAL_CERT=certificate_path# Optional for using SSL.
then also you have to modify laravel-websockets config file to enable client events which is required to get it working well:
You can make changes on this config file as your needs for other options available.
config/websockets.php
...
'apps' => [
[
...
'enable_client_messages' => true, # Set to `true`
...
],
],
...
and make sure you're running the websockets server.
That's all you need 🚀.
if you change the env variables or any related config, then you may need to restart your websockets server.
Laravel Reverb
First, you need to install Laravel Reverb. You can install it via composer by running the following command: