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