Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mohmmaedFayez's avatar

Pusher with laravel 5.6 not working

I'm trying to use pusher with laravel 5.6 and vue.js but i'm always getting error message

uncaught exception: You must pass your app key when you instantiate Pusher.

i already created free pusher account and i posted my appkey at .env file

PUSHER_APP_ID=772696 PUSHER_APP_KEY=dd1cd7da28e211a41bd7 PUSHER_APP_SECRET=5df9e7be8081a078c1d9 PUSHER_APP_CLUSTER=eu

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

and at bootstrab.js i already created new echo instance and posted my pusher settings like this

import Echo from 'laravel-echo' window.Pusher = require('pusher-js');

window.Echo = new Echo({ broadcaster: 'pusher', // key: 'dd1cd7da28e211a41bd7', // broadcaster: 'pusher', key: process.env.MIX_PUSHER_APP_KEY, cluster:process.env.MIX_PUSHER_APP_CLUSTER, encrypted: true });

pusher.log=function(message) { window.console.log(message) }

can some body help to solve this issue please...

0 likes
3 replies
Punksolid's avatar

There are two steps to make it work, one from your server to pusher, and another one from pusher to your client. First make sure one of them is working. In the debug tab in in the pusher panel you could see the messages and the connections, and simulate them, you will see the messages received by your server and the connections from your client.

Put in your client the listener for the channel you are trying to do.

windows.Echo.channel('orders')
    .listen('OrderShipped', (e) => {
        console.log(e.order.name);
    });

Please or to participate in this conversation.