laravel-websockets/src/Concerns/PushesToPusher.php

28 lines
649 B
PHP
Raw Normal View History

2020-08-23 16:12:22 +00:00
<?php
2020-08-27 18:57:58 +00:00
namespace BeyondCode\LaravelWebSockets\Concerns;
2020-08-23 16:12:22 +00:00
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(
2020-08-27 11:13:17 +00:00
new Pusher(
$app['key'],
$app['secret'],
$app['id'],
config('broadcasting.connections.pusher.options', [])
)
2020-08-23 16:12:22 +00:00
);
}
}