Answer the question
In order to leave comments, you need to log in
Why is pusher not connected in Laravel application?
Illuminate \ Broadcasting \ BroadcastException
No message
This error is thrown by the application when it comes to executing this code in the controller
broadcast(new CommentCreated($comment))->toOthers();
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_CLUSTER'),
'encrypted' => false,
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],
PUSHER_APP_ID=852064
PUSHER_APP_KEY=6673f5e00bb33e0a31c7
PUSHER_APP_SECRET=336df7cb41ea7b62e6db
PUSHER_APP_CLUSTER=us2
import Echo from 'laravel-echo'
window.Pusher = require('pusher-js');
window.Echo = new Echo({
broadcaster: 'pusher',
key: '6673f5e00bb33e0a31c7',
cluster: 'us2',
encrypted: false
});
php artisan config:cache
add curl_options, clear the cache, and still the same error.
Answer the question
In order to leave comments, you need to log in
In general, I solved the problem by tracing each file in the course of script execution. It turned out that the error in the broadcasting.php file
where cluster is taken from env('PUSHER_CLUSTER)
The problem is that this field is written in the env file as PUSHER_APP_CLUSTER
Hence all the troubles, I don’t know if these settings are from the box, or I’m somewhere it's not copy-pasted, but in general be careful with this)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question