I followed the instruction from this link to create a web push using pusher: https://blog.pusher.com/create-web-notifications-using-laravel-pusher/
But when i tried to fire my event, i cant see any event catch in my pusher dashboard debug console.
Here is the screenshot of my test
Here are some code
route/web.php :
Route::get('/eventtest', function () {
event(new App\Events\StatusChanged('someone'));
return "Event has been sent!";
});
event class :
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class StatusChanged implements ShouldBroadcast
{
use InteractsWithSockets, SerializesModels;
public $message;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct($message)
{
$this->message = $message;
}
/**
* Get the channels the event should broadcast on.
*
* @return Channel|array
*/
public function broadcastOn()
{
// return new PrivateChannel('statusChanged');
return ['status-changed'];
}
}
broadcasting config :
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_KEY'),
'secret' => env('PUSHER_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => 'ap1',
'encrypted' => true
],
],
App\Providers\BroadcastServiceProvider::class,
inconfig/app.php
?'eu'
inbroadcast.php
.