php - How to generate real time notification system like facebook in laravel -


i want create real time notification system website(social network) i'm using laravel 5.2, using socket.io , redis currently, have created notifevent , broadcasted succesfully, no idea ahead, can please me or guide me.

  1. you should have nodejs , socket.io, install on server
  2. when have event, use redis hold variable , send nodejs or use php library, can send variable php nodejs server: http://elephant.io/
  3. data processing on nodejs
  4. return php webpage use socket.io (client javascript) catch event , display end-user (using emit , on)

you can follow instruction elephant.io: using php socket.io

or redis: https://github.com/laracasts/laravel-redis-and-socket.io

you should try 2 ways , feedback new question if stuck because question unclear , hard answer

you can use javascript send ajax request , variable php , use variable make socket.emit way less security, must use token or if want public website


Comments