https://github.com/sohelamin/laravel-event-broadcast
Laravel event broadcasting with Node.js, Redis & Socket.io
https://github.com/sohelamin/laravel-event-broadcast
events laravel redis socket-io
Last synced: 6 months ago
JSON representation
Laravel event broadcasting with Node.js, Redis & Socket.io
- Host: GitHub
- URL: https://github.com/sohelamin/laravel-event-broadcast
- Owner: sohelamin
- Created: 2015-09-01T12:49:53.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-11-12T14:43:32.000Z (almost 9 years ago)
- Last Synced: 2025-04-02T15:11:12.069Z (6 months ago)
- Topics: events, laravel, redis, socket-io
- Language: CSS
- Homepage:
- Size: 6.44 MB
- Stars: 8
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Event Broadcasting Example
Laravel event broadcasting with Node.js, Redis & Socket.io### Requirements
Node.js
Redis
Socket.io## Installation
1. Clone the the repository
```
git clone https://github.com/sohelamin/laravel-event-broadcast.git
```2. Navigate to your project directory and run
```
composer install
npm install
php -r "file_exists('.env') || copy('.env.example', '.env');"
php artisan key:generate
```## Usage
1. Start your project
```
php artisan serve
```2. Run socket.io using node
```
node socket.js
```3. Broadcast your event via ```http://localhost:8000/broadcast``` & listen via ```http://localhost:8000/listen```
### Via Docker
1. Start the docker's containers
```
docker-compose up -d
```1. Migrate tables & Listen the queues
```
docker exec -it laraveleventbroadcast_app_1 bash
cd /var/www
php artisan migrate
php artisan queue:listen
```3. Run node
```
docker exec -it laraveleventbroadcast_app_1 bash
cd /var/www
node socket.js
```3. Broadcast your event via ```http://localhost/broadcast``` & listen via ```http://localhost/listen```
##Author
[Sohel Amin](http://www.sohelamin.com)