具有不同Pusher应用程序键的多个Laravel Echo实例

时间:2019-02-15 02:59:45

标签: laravel laravel-5.4 pusher laravel-echo pusher-js

window.alpha = new Echo({
  broadcaster: 'alpha_pusher',
  key: 'alpha-pusher-key'
});

window.beta = new Echo({
  broadcaster: 'beta_pusher',
  key: 'beta-pusher-key'
});

是否可以在一个Laravel 5.4项目中实现这一目标?据我尝试过,Laravel只允许我们选择一个广播驱动程序。

'alpha_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'),
        'encrypted' => true,
    ],
]

.env

BROADCAST_DRIVER=alpha_pusher

0 个答案:

没有答案