2👍
VueJs
window.Echo.channel("channel-name").listen(".channel-app", e => {
console.log(e);
});
Laravel
Event
public function broadcastOn()
{
return new Channel('channel-name');
}
public function broadcastAs()
{
return 'channel-app';
}
Controller
public function test()
{
broadcast(new MessageSent());
}
channel
Broadcast::channel('channel-name', function(){ return true; });
- [Vuejs]-Change color on bootstrap using vue.js
- [Vuejs]-Vuejs get request from PHP/MySQL doesn't work
Source:stackexchange.com