Open hayjay opened 6 years ago
I got it working
in your .env file change from log BROADCAST_DRIVER=log
to pusher BROADCAST_DRIVER=pusher
add 'Pusher' => Pusher\Pusher::class, to your app config aliases
Add to MyEvent event
public function broadcastAs() { return '//name of your even goes here eg: my-event'; }
In the welcome.blade.php add the return of the broadcastAs method eg: my-event to the channel.bind method
channel.bind('my-event', function(data) {......
After this it should work
Ok great thanks!
I will try it out!
I follow @kodunmi but still not working. Then I open config/broadcasting.php
and change following setting
'default' => env('BROADCAST_DRIVER', 'null')
to
'default' => "pusher"
and it's working.
It is like laravel didn't read my .env
file.
When the
/test
route is been clicked the necessary navbar notification isn't popping up on the other browser tab. You may need to use laravel Echo to fix or npm to require pusher it self.