在服务器上更新某些数据如何实时更新用户界面?

时间:2016-09-01 17:37:46

标签: php laravel

我有一个使用laravel开发的网站。我有两页,第一页用于提交用户详细信息,第二页用于列出数据。对于提交用户详细信息,路由或网址如www.test.dev/usersubmit为了列出用户详细信息,路由或网址如www.test.dev/userlist我的目的是当我从第一页推送或提交用户详细信息时,在列表中页面(第二页)数据加载没有刷新页面。为此需要研究哪种技术?我们需要节点js还是套接字js?如果有任何包可用于laravel。请帮我找一个好的解决方案。感谢

1 个答案:

答案 0 :(得分:1)

you could use node/socket for push notification or you could use pusher service for the same result, and in the front end update the view when you receive a notification event.

also laravel 5.3 has built in support for pusher. see https://laravel.com/docs/5.3/broadcasting

alternatively you could use polling to check for updates every 30 seconds or so