#I need a help with broadcasting

2 messages · Page 1 of 1 (latest)

keen slate
#

`Description
I need a help i am currently studying Laravel but i am watching laravel 9 tutorial mine is 11 so the 11 pusher broadcasting configuration looks like different i am using localhost to run server there is not error showing its not responding

Relevant code
//.env

BROADCAST_CONNECTION=pusher PUSHER_APP_ID="1856571"
PUSHER_APP_KEY="321e19130359b808bc9d"
PUSHER_APP_SECRET="d2266c2fbc119adb5d61"
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME="https"
PUSHER_APP_CLUSTER="ap2"

//brodcast.php

'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
'port' => env('PUSHER_PORT', 443),
'scheme' => env('PUSHER_SCHEME', 'https'),
'encrypted' => true,
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
],
'client_options' => [
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
],
],

//admin.blade.php

<script src="https://js.pusher.com/8.2.0/pusher.min.js"></script>
<h1>welcome to laravel pusher</h1>

<script>
// Enable pusher logging - don't include this in production
Pusher.logToConsole = true;
var pusher= new Pusher('321e19130359b808bc9d',{
cluster:'ap2'
})

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

</script>`

#

I need a help i am currently studying Laravel but i am watching laravel 9 tutorial mine is 11