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

BUG: broadcasting.php required modifications #79

Closed
tarreislam opened this issue Mar 13, 2024 · 4 comments · Fixed by #84
Closed

BUG: broadcasting.php required modifications #79

tarreislam opened this issue Mar 13, 2024 · 4 comments · Fixed by #84
Assignees

Comments

@tarreislam
Copy link

tarreislam commented Mar 13, 2024

Laravel ver
10->11

PHP VER
8.3

Description+Reproduce

Before I could get reverb to broadcast eventsI had to make sure the configuration was done in config/broadcasting.php

        'reverb' => [ // notice reverb
            'driver' => 'reverb', // notice reverb
            'key' => env('PUSHER_APP_KEY', 'app-key'),
            'secret' => env('PUSHER_APP_SECRET', 'app-secret'),
            'app_id' => env('PUSHER_APP_ID', 'app-id'),
            'options' => [
                'host' => env('PUSHER_HOST', '127.0.0.1'),
                'port' => env('PUSHER_PORT', 6001),
                'scheme' => env('PUSHER_SCHEME', 'http'),
                'encrypted' => false,
                'useTLS' => env('PUSHER_SCHEME') === 'https',
            ]
        ],

I just copied pusher and changed name and driver to reverb

I am comming from laravel 10 to laravel 11

Otherwise I would get

Pusher error: auth_key should be a valid app key
.

  at vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php:164
    160▕             $channels->chunk(100)->each(function ($channels) use ($event, $payload, $parameters) {
    161▕                 $this->pusher->trigger($channels->toArray(), $event, $payload, $parameters);
    162▕             });
    163▕         } catch (ApiErrorException $e) {
  ➜ 164▕             throw new BroadcastException(
    165▕                 sprintf('Pusher error: %s.', $e->getMessage())
    166▕             );
    167▕         }
    168▕     }

  i   Here are some links that might help solve this problem:
      https://laravel.com/docs/11.x/authentication
 
@joedixon
Copy link
Collaborator

Did you run the reveb:install command?

@tarreislam
Copy link
Author

tarreislam commented Mar 13, 2024

Did you run the reveb:install command?

Yes I did

EDIT:

I noticed in the code that you attempt to inject it, you should however add to the documentation that this is required for it to work

@fylzero
Copy link

fylzero commented Mar 14, 2024

@tarreislam Something has to be mistaken here - reverb would be using the pusher connection/driver.

@fylzero
Copy link

fylzero commented Mar 14, 2024

@tarreislam Ignore me - trying to get this running in a Laravel 10 upgraded project as well - seems you are correct about the broadcasting config - this is only added with new applications, not upgraded ones.

Block should be:

        'reverb' => [
            'driver' => 'reverb',
            'key' => env('REVERB_APP_KEY'),
            'secret' => env('REVERB_APP_SECRET'),
            'app_id' => env('REVERB_APP_ID'),
            'options' => [
                'host' => env('REVERB_HOST'),
                'port' => env('REVERB_PORT', 443),
                'scheme' => env('REVERB_SCHEME', 'https'),
                'useTLS' => env('REVERB_SCHEME', 'https') === 'https',
            ],
            'client_options' => [
                // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
            ],
        ],

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

Successfully merging a pull request may close this issue.

4 participants