You can read more about my project to understand the process of broadcasting with Redis, Laravel Echo Server, Socket.IO Client via my LinkedIn
- Go to
echo-dockerfolder to start containers - Run command:
docker-composer up -datecho-docker - Check running dockers:
docker ps - Get IPAddresss of
chat_dbandchat_rediscontainers:docker inspect chat_redis | grep IPAddress - Make
.envfile:cp .env.example .env - Update
.envfile atsocket_appfolder
DB_CONNECTION=mysql DB_HOST=chat_db DB_PORT=3306 DB_DATABASE=chat_app DB_USERNAME=root DB_PASSWORD=root@secret123 BROADCAST_DRIVER=redis CACHE_DRIVER=file QUEUE_CONNECTION=redis SESSION_DRIVER=file SESSION_LIFETIME=120 REDIS_HOST=chat_redis REDIS_PASSWORD=null REDIS_PORT=6379 REDIS_CLIENT=predis REDIS_PREFIX=""
- Configure project as below commands:
docker exec -it app_server bash composer install npm install npm run dev php artisan key:generate php artisan migrate php artisan queue:work
- Open other terminal to run this commmand:
npm install -g laravel-echo-server laravel-echo-server start
- Start chat project
http://localhost:8000