28 lines
650 B
PHP
28 lines
650 B
PHP
<?php
|
|
|
|
namespace BeyondCode\LaravelWebSockets\Contracts;
|
|
|
|
use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster;
|
|
use Pusher\Pusher;
|
|
|
|
trait PushesToPusher
|
|
{
|
|
/**
|
|
* Get the right Pusher broadcaster for the used driver.
|
|
*
|
|
* @param array $app
|
|
* @return \Illuminate\Broadcasting\Broadcasters\Broadcaster
|
|
*/
|
|
public function getPusherBroadcaster(array $app)
|
|
{
|
|
return new PusherBroadcaster(
|
|
new Pusher(
|
|
$app['key'],
|
|
$app['secret'],
|
|
$app['id'],
|
|
config('broadcasting.connections.pusher.options', [])
|
|
)
|
|
);
|
|
}
|
|
}
|