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

Joeseph Chen's avatar

Pusher Stop Working On Production

Hello, first of all, sorry for my bad english it is not my native. I kind of stuck on this problem for 2 days, my search for the solution doesn't produce any result. So I hope this wonderful community can help me with this.

As the title said, the pusher is all working fine when on local server, I had another project before that also working fine when uploaded to production server, the difference is the previous project is the LEMP stack i setup myself on Digital Ocean, for this project I tried using Forge to manage the server.

After following all the documentation to setup my server, the site is up and running, but the problem is all my pusher notification suddenly stop working.

Maybe someone can spot the mistake I made.

Here is my config/broadcasting.php file

'connections' => [

        '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'),
                'useTLS'    => true,
                'encrypted' => true
            ],
            'client_options' => [
                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
            ],
        ],

...
]

my resources/js/bootstrap.js

import Echo from 'laravel-echo';

window.Pusher = require('pusher-js');

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

my routes/channels.php

Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
    return (int) $user->id === (int) $id;
});

Broadcast::channel('App.Models.Team.{id}', function ($user, $id) {
    return $user->teams->contains('id', $id);
});

I had also uncommented BroadcastServiceProvider::class on the config/app.php

all this is working fine on my previous project with LEMP stack at Digital Ocean.

But now it is not working on Forge, is there something I do wrong?

note: I'm using SSL on my site, the project is using built using livewire.

any help much appreciated.

0 likes
0 replies

Please or to participate in this conversation.