Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pusher not working, chat need to refresh page after send #5

Open
fernandbong opened this issue May 19, 2020 · 4 comments
Open

Pusher not working, chat need to refresh page after send #5

fernandbong opened this issue May 19, 2020 · 4 comments

Comments

@fernandbong
Copy link

After sending a message, chat does not appear in realtime. It need to refresh to get the message.

@gokhanpeker
Copy link

I have this problem too..

@gokhanpeker
Copy link

The problem is solved by correct .env options.

@samironbarai
Copy link
Owner

The problem is solved by correct .env options.

You can provide your answer so that others can get helped :)

@gokhanpeker
Copy link

Of course Samiron :)

I change three files.

First .env file

BROADCAST_DRIVER=pusher

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=

this credentials can be found in pusher account, channels(projects) -> App Keys

Second file is HomeController, sendMessage function

// pusher
$options = array(
'cluster' => 'eu',
'useTLS' => true
);

    $pusher = new Pusher(
        env('PUSHER_APP_KEY'),
        env('PUSHER_APP_SECRET'),
        env('PUSHER_APP_ID'),
        $options
    );

and the finnal one app.blade file inside resources->views->layouts->app.blade

we need the change with pusher app key with between Pusher(' ',

var pusher = new Pusher('1d914f493de58f18', {
cluster: 'eu',
forceTLS: true
});

And finnaly we need to run: npm run dev
with console.

It's working like a charm. Thank you very much :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants