Here I have showing you that how to work with broadcast your events over a WebSocket connection.
- Using Laravel Event Broadcasting
- You can use this thing laravel 5.4 and greater version.
The following are required to function properly.
- Node 6.0+
- Redis 3+
- laravel-echo-server laravel-echo-server
Step : 1
git clone https://github.com/sagarankoliya/laravel-event-broadcasting-socket.io.git
Step : 2
Go to project directory using Terminal / CMD
composer install
Step : 3
In project directory find .env.example and rename to .env
Generate laravel application key
php artisan key:generate
Also change in .env
BROADCAST_DRIVER=redis
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
Step : 4
install Node dependencies
npm install
Step : 5
Run Project
php artisan serve
Step : 6
Open project directory in second Terminal / CMD
laravel-echo-server start
Open http://127.0.0.1:8000 url in multipal brower
than after click Call Event button from any of browser screen, alert will show on all browsers, that is your response.
Feel free to contact me if you have any query. (^_^)