This is simple chat application using standard libraries except 'laravel-echo-server' which I think completely unnecessary.
Clone this repository into your machine.
git clone https://github.com/gdbhosale/chat-laravel-socketio-redis-vuejs.git
Install Laravel
composer install
Make sure you have your .env
configuration as below:
SOCKET_PORT=3000
BROADCAST_DRIVER=redis
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_DRIVER=redis
Install Redis server
// Ubuntu
sudo apt-get install redis-server
// MacOS
brew install redis
Run Redis server in new terminal window / tab
redis-server
This application needs Laravel Queue to Run Events Broadcasting. Make sure you have used QUEUE_DRIVER=redis
.
Run Laravel Queue Command in new terminal window / tab
php artisan queue:listen
Now you need to download Socket.IO server and other dependencies via npm.
npm install
Now start Socket.IO server
node socket.js
Now Check your application in Browser.
Get List of All Basic Changes for Simple Laravel-Socket.IO Application here: Changes.md
Follow me on Twitter or Github. Check Laravel Admin Panel created by me: LaraAdmin