https://github.com/tlaverdure/laravel-echo-server
Create laravel-echo-server.json file in your repo with laravel-echo-server init
.
$ laravel-echo-server init
? Do you want to run this server in development mode? No
? Which port would you like to serve from? 6001
? Which database would you like to use to store presence channel members? sqlite
? Enter the host of your Laravel authentication server. http://localhost
? Will you be serving on http or https? http
? Do you want to generate a client ID/Key for HTTP API? Yes
? Do you want to setup cross domain access to the API? No
? What do you want this config to be saved as? laravel-echo-server.json
appId: 7681984290a51901
key: cdaf9c5b64d7d1be72b735c58e951241
Configuration file saved. Run laravel-echo-server start to run server.
Change .env file.
BROADCAST_DRIVER=laravel_echo_server
[...]
LARAVEL_ECHO_SERVER_APP_ID=7681984290a51901
LARAVEL_ECHO_SERVER_APP_KEY=cdaf9c5b64d7d1be72b735c58e951241
LARAVEL_ECHO_SERVER_HOST=localhost
LARAVEL_ECHO_SERVER_PORT=6001
LARAVEL_ECHO_SERVER_DEBUG=true
Add connection to config/broadcasting.php file.
'default' => env('BROADCAST_DRIVER', 'null'),
//...
'connections' => [
//...
'laravel_echo_server' => [
'driver' => 'pusher',
'key' => env('LARAVEL_ECHO_SERVER_APP_KEY'),
'secret' => env('LARAVEL_ECHO_SERVER_APP_SECRET'),
'app_id' => env('LARAVEL_ECHO_SERVER_APP_ID'),
'options' => [
'host' => env('LARAVEL_ECHO_SERVER_HOST'),
'port' => env('LARAVEL_ECHO_SERVER_PORT'),
'scheme' => 'http'
],
],
//...