Laravel event broadcasting with Node.js, Redis & Socket.io
Node.js
Redis
Socket.io
-
Clone the the repository
git clone https://github.com/sohelamin/laravel-event-broadcast.git
-
Navigate to your project directory and run
composer install npm install php -r "file_exists('.env') || copy('.env.example', '.env');" php artisan key:generate
-
Start your project
php artisan serve
-
Run socket.io using node
node socket.js
-
Broadcast your event via
http://localhost:8000/broadcast
& listen viahttp://localhost:8000/listen
-
Start the docker's containers
docker-compose up -d
-
Migrate tables & Listen the queues
docker exec -it laraveleventbroadcast_app_1 bash cd /var/www php artisan migrate php artisan queue:listen
-
Run node
docker exec -it laraveleventbroadcast_app_1 bash cd /var/www node socket.js
-
Broadcast your event via
http://localhost/broadcast
& listen viahttp://localhost/listen
##Author