I want to create a real time notification system for my website(social network) I'm using laravel 5.2, I am using socket.io and redis currently, I have created notifevent and broadcasted it succesfully, but no idea what to do ahead, can anyone please help me with it or guide me.
NodeJS
and socket.io
, install it on your serverRedis
to hold your variable and send it to your NodeJs
or Use this PHP Library, you can send variable from PHP
to NodeJS
Server: http://elephant.io/NodeJs
Socket.io (client javascript)
to catch this event and display for end-user (using emit
and on
)You can follow this instruction with elephant.io
: Using PHP with Socket.io
or that with Redis
: https://github.com/laracasts/Laravel-Redis-and-Socket.io
You should try two ways and feedback with new question if you stuck because your question is unclear and very hard to answer
You can use javascript
send Ajax Request and get variable from PHP
and use this variable to make a socket.emit
but this way is less security, you must use token
or anything like this if you want to public your website