src/Subscriptions/BroadcastManager.php
protected function createPusherDriver(array $config): PusherBroadcaster
    {
        $connection = $config['connection'] ?? 'pusher';
        $driverConfig = config("broadcasting.connections.{$connection}");

        if (empty($driverConfig) || $driverConfig['driver'] !== 'pusher') {
            throw new RuntimeException("Could not initialize Pusher broadcast driver for connection: {$connection}.");
        }

        $appKey = Arr::get($driverConfig, 'key');
        $appSecret = Arr::get($driverConfig, 'secret');
        $appId = Arr::get($driverConfig, 'app_id');
        $options = Arr::get($driverConfig, 'options', []);

        $pusher = new Pusher($appKey, $appSecret, $appId, $options);

        return new PusherBroadcaster($pusher);
    }
protected function createPusherDriver(array $config): PusherBroadcaster
    {
        $connection = $config['connection'] ?? 'pusher';
        $driverConfig = config("broadcasting.connections.{$connection}");

        if (empty($driverConfig) || $driverConfig['driver'] !== 'pusher') {
            throw new RuntimeException("Could not initialize Pusher broadcast driver for connection: {$connection}.");
        }

        $appKey = Arr::get($driverConfig, 'key');
        $appSecret = Arr::get($driverConfig, 'secret');
        $appId = Arr::get($driverConfig, 'app_id');
        $options = Arr::get($driverConfig, 'options', []);

        $pusher = new Pusher($appKey, $appSecret, $appId, $options);

        return new PusherBroadcaster($pusher);
    }
protected function createPusherDriver ( array $ config ) : PusherBroadcaster { $ connection = $ config [ 'connection' ] ?? 'pusher' ; $ driverConfig = config ( "broadcasting.connections.{$connection}" ) ; if ( empty ( $ driverConfig ) || $ driverConfig [ 'driver' ] !== 'pusher' ) { throw new RuntimeException ( "Could not initialize Pusher broadcast driver for connection: {$connection}." ) ; } $ appKey = Arr :: get ( $ driverConfig , 'key' ) ; $ appSecret = Arr :: get ( $ driverConfig , 'secret' ) ; $ appId = Arr :: get ( $ driverConfig , 'app_id' ) ; $ options = Arr :: get ( $ driverConfig , 'options' , [ ] ) ; $ pusher = new Pusher ( $ appKey , $ appSecret , $ appId , $ options ) ; return new PusherBroadcaster ( $ pusher ) ; }
Create instance of pusher driver.

@param  mixed[]  $config
@return \Nuwave\Lighthouse\Subscriptions\Broadcasters\PusherBroadcaster
@throws \Pusher\PusherException
Create instance of pusher driver .