John Davidson

php - Broadcast or event doesnt do anything

0 comments
Message:


I wanted to add some pusher stuff on my app with laravel broadcasting however using broadcast() or event() helpers doesn't do anything and I have no errors.


Added my pusher info to env, changed broadcasting driver from log to pusher and neither worked. Created test event with channel name 'my-channel' and event name 'my-event'. Some dummy data in event and tried to call broadcast/event helpers with that event.


Also started PHP artisan queue:work --tries=3


And added composer require pusher/pusher-php-server


Nothing works, not even calling event(new TestEvent()) from tinker.


Only thing that works is using Pusher class directly:


$P = NEW Pusher\Pusher('KEY','SECRET','ID', ['cluster' => 'eu']); 
$P->trigger('my-channel', 'my-event', ['message' => 'test']);


My Answer:
'us']);
$P->trigger('my-channel', 'my-event', ['message' => 'hello world']);

Rate this post

3 of 5 based on 3020 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us