Skeets
Skeets

Reputation: 4818

Laravel's `broadcast` function doing nothing

Running Laravel 5.5, PHP 7.0 on Ubuntu with Apache2.

I have this line of code:

broadcast(new \App\Events\Event("test"));

And I have the broadcaster set to "log" in /config/broadcasting.php:

'default' => "log",

And I have BroadcastServiceProvider enabled in app.php in both places.

However, nothing is being logged in storage/logs/laravel.log. (other logs are appearing just fine)

I tried setting the broadcaster to redis as well, but broadcasting the event does not create a redis value/key pair, even though Redis::set() is working fine.

Am I missing a step? What else do I need to do to get the broadcast function working?

Upvotes: 0

Views: 174

Answers (1)

Funfare
Funfare

Reputation: 156

Implement the ShouldBroadcast Interface on the Event
https://laravel.com/docs/5.6/broadcasting#using-example-application

For reference this is what it looks like:

enter image description here

Upvotes: 1

Related Questions