Laravel 5.4 with Pusher IlluminateBroadcastingBroadcastException’ with message ‘404 NOT FOUND

I’m attempting to get Pusher working with Laravel 5.4, but I keep running into the push failing in the queue. I’ve tested the Channel from the Pusher debug console and it works without issue. I can also see the browser listening on the chosen channel. I’ve followed the setup on the Pusher getting started page. I’ve used artisan to clear config and cache, done a httpd restart as well to be sure.

I don’t know if I am missing a step, or something else. I’ve seen this question asked a few times on here, but each solution which I’ve encorporated below, doesn’t resolve the issue.

Hoping someone can come up with a suggestion.

Thanks in advance.

Setup

.env (Setup, and checked is working correctly):

APP_URL=*****
DB_HOST=*****
BROADCAST_DRIVER=pusher
PUSHER_APP_ID=******
PUSHER_APP_KEY=*******************
PUSHER_APP_SECRET=***********************

broadcasting.php (Added CURL options, no success):

    'pusher' => [
'driver' => 'pusher',
'key' => config('services.pusher.app_key'),
'secret' => config('services.pusher.app_secret'),
'app_id' => config('services.pusher.app_id'),
'options' => [
'cluster' => 'ap4',
'useTLS' => true,
'curl_options' => [
CURLOPT_SSL_VERIFYHOST => 0,
CURLOPT_SSL_VERIFYPEER => 0,
]
],
],

TicketComment.php (Event)

<?php

namespace AppEvents;

use IlluminateQueueSerializesModels;
use IlluminateFoundationEventsDispatchable;
use IlluminateBroadcastingInteractsWithSockets;
use IlluminateContractsBroadcastingShouldBroadcast;

class TicketComment implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;

public $tries = 5;

public $username;

public $message;

/**
* Create a new event instance.
*
* @return void
*/
public function __construct($username)
{
$this->username = $username;
$this->message = "{$username} liked your status";
}

/**
* Get the channels the event should broadcast on.
*
* @return Channel|array
*/
public function broadcastOn()
{
return ['status-liked'];
}

public function broadcastAs() {

return 'event-liked';

}
}

global.js (front-end js):

    var _notificationListener = function(){
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;

var pusher = new Pusher('*******************', {
cluster: 'ap4',
encrypted: true
});

var channel = pusher.subscribe('my-channel');
channel.bind('event-liked', function(data) {
alert(JSON.stringify(data));
});
}

Queue (Exception):

exception 'IlluminateBroadcastingBroadcastException' with message '404 NOT FOUND
' in /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:106
Stack trace:
#0 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastEvent.php(49): IlluminateBroadcastingBroadcastersPusherBroadcaster->broadcast(Array, 'event-liked', Array)
#1 [internal function]: IlluminateBroadcastingBroadcastEvent->handle(Object(IlluminateBroadcastingBroadcastersPusherBroadcaster))
#2 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(30): call_user_func_array(Array, Array)
#3 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#4 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#5 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#6 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(94): IlluminateContainerContainer->call(Array)
#7 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(114): IlluminateBusDispatcher->IlluminateBus{closure}(Object(IlluminateBroadcastingBroadcastEvent))
#8 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): IlluminatePipelinePipeline->IlluminatePipeline{closure}(Object(IlluminateBroadcastingBroadcastEvent))
#9 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(98): IlluminatePipelinePipeline->then(Object(Closure))
#10 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/CallQueuedHandler.php(43): IlluminateBusDispatcher->dispatchNow(Object(IlluminateBroadcastingBroadcastEvent), NULL)
#11 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/Jobs/Job.php(69): IlluminateQueueCallQueuedHandler->call(Object(IlluminateQueueJobsDatabaseJob), Array)
#12 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(317): IlluminateQueueJobsJob->fire()
#13 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(267): IlluminateQueueWorker->process('database', Object(IlluminateQueueJobsDatabaseJob), Object(IlluminateQueueWorkerOptions))
#14 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/Worker.php(224): IlluminateQueueWorker->runJob(Object(IlluminateQueueJobsDatabaseJob), 'database', Object(IlluminateQueueWorkerOptions))
#15 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(102): IlluminateQueueWorker->runNextJob('database', 'default', Object(IlluminateQueueWorkerOptions))
#16 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Queue/Console/WorkCommand.php(86): IlluminateQueueConsoleWorkCommand->runWorker('database', 'default')
#17 [internal function]: IlluminateQueueConsoleWorkCommand->fire()
#18 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(30): call_user_func_array(Array, Array)
#19 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(87): IlluminateContainerBoundMethod::IlluminateContainer{closure}()
#20 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(31): IlluminateContainerBoundMethod::callBoundMethod(Object(IlluminateFoundationApplication), Array, Object(Closure))
#21 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Container/Container.php(539): IlluminateContainerBoundMethod::call(Object(IlluminateFoundationApplication), Array, Array, NULL)
#22 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Console/Command.php(182): IlluminateContainerContainer->call(Array)
#23 /var/www/html/php56/ml/vendor/symfony/console/Command/Command.php(255): IlluminateConsoleCommand->execute(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#24 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Console/Command.php(168): SymfonyComponentConsoleCommandCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(IlluminateConsoleOutputStyle))
#25 /var/www/html/php56/ml/vendor/symfony/console/Application.php(963): IlluminateConsoleCommand->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#26 /var/www/html/php56/ml/vendor/symfony/console/Application.php(254): SymfonyComponentConsoleApplication->doRunCommand(Object(IlluminateQueueConsoleWorkCommand), Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#27 /var/www/html/php56/ml/vendor/symfony/console/Application.php(147): SymfonyComponentConsoleApplication->doRun(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#28 /var/www/html/php56/ml/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(122): SymfonyComponentConsoleApplication->run(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#29 /var/www/html/php56/ml/artisan(36): IlluminateFoundationConsoleKernel->handle(Object(SymfonyComponentConsoleInputArgvInput), Object(SymfonyComponentConsoleOutputConsoleOutput))
#30 {main}

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/35v8R3X
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.